| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2993 | 2993 |
| 2994 // Return the generated code. | 2994 // Return the generated code. |
| 2995 return GetCode(Code::CALLBACKS, name); | 2995 return GetCode(Code::CALLBACKS, name); |
| 2996 } | 2996 } |
| 2997 | 2997 |
| 2998 | 2998 |
| 2999 #undef __ | 2999 #undef __ |
| 3000 #define __ ACCESS_MASM(masm) | 3000 #define __ ACCESS_MASM(masm) |
| 3001 | 3001 |
| 3002 | 3002 |
| 3003 void LoadStubCompiler::GenerateLoadArrayLength( |
| 3004 MacroAssembler* masm, |
| 3005 Register holder) { |
| 3006 // ----------- S t a t e ------------- |
| 3007 // -- ecx : name |
| 3008 // -- edx : receiver |
| 3009 // -- esp[0] : return address |
| 3010 // ----------------------------------- |
| 3011 |
| 3012 // Load length directly from the JS array. |
| 3013 __ mov(eax, FieldOperand(holder, JSArray::kLengthOffset)); |
| 3014 __ ret(0); |
| 3015 } |
| 3016 |
| 3017 |
| 3018 #undef __ |
| 3019 #define __ ACCESS_MASM(masm()) |
| 3020 |
| 3021 |
| 3022 Handle<Code> LoadStubCompiler::CompileLoadArrayLength( |
| 3023 Handle<String> name, |
| 3024 Handle<JSObject> receiver, |
| 3025 Handle<JSObject> holder) { |
| 3026 // ----------- S t a t e ------------- |
| 3027 // -- ecx : name |
| 3028 // -- edx : receiver |
| 3029 // -- esp[0] : return address |
| 3030 // ----------------------------------- |
| 3031 Label miss; |
| 3032 |
| 3033 // Check that the maps haven't changed. |
| 3034 __ JumpIfSmi(edx, &miss); |
| 3035 Register holder_reg = CheckPrototypes( |
| 3036 receiver, edx, holder, ebx, eax, edi, name, &miss); |
| 3037 |
| 3038 GenerateLoadArrayLength(masm(), holder_reg); |
| 3039 |
| 3040 __ bind(&miss); |
| 3041 GenerateLoadMiss(masm(), Code::LOAD_IC); |
| 3042 |
| 3043 // Return the generated code. |
| 3044 return GetCode(Code::CALLBACKS, name, |
| 3045 Code::ExtraICStateForeignCallbackArrayLength); |
| 3046 } |
| 3047 |
| 3048 |
| 3049 #undef __ |
| 3050 #define __ ACCESS_MASM(masm) |
| 3051 |
| 3052 |
| 3003 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, | 3053 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
| 3004 Handle<JSFunction> getter) { | 3054 Handle<JSFunction> getter) { |
| 3005 // ----------- S t a t e ------------- | 3055 // ----------- S t a t e ------------- |
| 3006 // -- ecx : name | 3056 // -- ecx : name |
| 3007 // -- edx : receiver | 3057 // -- edx : receiver |
| 3008 // -- esp[0] : return address | 3058 // -- esp[0] : return address |
| 3009 // ----------------------------------- | 3059 // ----------------------------------- |
| 3010 { | 3060 { |
| 3011 FrameScope scope(masm, StackFrame::INTERNAL); | 3061 FrameScope scope(masm, StackFrame::INTERNAL); |
| 3012 | 3062 |
| (...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4353 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4403 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
| 4354 } | 4404 } |
| 4355 } | 4405 } |
| 4356 | 4406 |
| 4357 | 4407 |
| 4358 #undef __ | 4408 #undef __ |
| 4359 | 4409 |
| 4360 } } // namespace v8::internal | 4410 } } // namespace v8::internal |
| 4361 | 4411 |
| 4362 #endif // V8_TARGET_ARCH_IA32 | 4412 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |