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 2978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2989 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, no_reg, | 2989 GenerateLoadCallback(object, holder, edx, ecx, ebx, eax, edi, no_reg, |
2990 callback, name, &miss); | 2990 callback, name, &miss); |
2991 __ bind(&miss); | 2991 __ bind(&miss); |
2992 GenerateLoadMiss(masm(), Code::LOAD_IC); | 2992 GenerateLoadMiss(masm(), Code::LOAD_IC); |
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 __ |
| 3000 #define __ ACCESS_MASM(masm) |
| 3001 |
| 3002 |
| 3003 void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
| 3004 Handle<JSFunction> getter) { |
| 3005 // ----------- S t a t e ------------- |
| 3006 // -- ecx : name |
| 3007 // -- edx : receiver |
| 3008 // -- esp[0] : return address |
| 3009 // ----------------------------------- |
| 3010 { |
| 3011 FrameScope scope(masm, StackFrame::INTERNAL); |
| 3012 |
| 3013 if (!getter.is_null()) { |
| 3014 // Call the JavaScript getter with the receiver on the stack. |
| 3015 __ push(edx); |
| 3016 ParameterCount actual(0); |
| 3017 __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(), |
| 3018 CALL_AS_METHOD); |
| 3019 } else { |
| 3020 // If we generate a global code snippet for deoptimization only, remember |
| 3021 // the place to continue after deoptimization. |
| 3022 masm->isolate()->heap()->SetGetterStubDeoptPCOffset(masm->pc_offset()); |
| 3023 } |
| 3024 |
| 3025 // Restore context register. |
| 3026 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
| 3027 } |
| 3028 __ ret(0); |
| 3029 } |
| 3030 |
| 3031 |
| 3032 #undef __ |
| 3033 #define __ ACCESS_MASM(masm()) |
| 3034 |
| 3035 |
2999 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( | 3036 Handle<Code> LoadStubCompiler::CompileLoadViaGetter( |
3000 Handle<String> name, | 3037 Handle<String> name, |
3001 Handle<JSObject> receiver, | 3038 Handle<JSObject> receiver, |
3002 Handle<JSObject> holder, | 3039 Handle<JSObject> holder, |
3003 Handle<JSFunction> getter) { | 3040 Handle<JSFunction> getter) { |
3004 // ----------- S t a t e ------------- | 3041 // ----------- S t a t e ------------- |
3005 // -- ecx : name | 3042 // -- ecx : name |
3006 // -- edx : receiver | 3043 // -- edx : receiver |
3007 // -- esp[0] : return address | 3044 // -- esp[0] : return address |
3008 // ----------------------------------- | 3045 // ----------------------------------- |
3009 Label miss; | 3046 Label miss; |
3010 | 3047 |
3011 // Check that the maps haven't changed. | 3048 // Check that the maps haven't changed. |
3012 __ JumpIfSmi(edx, &miss); | 3049 __ JumpIfSmi(edx, &miss); |
3013 CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss); | 3050 CheckPrototypes(receiver, edx, holder, ebx, eax, edi, name, &miss); |
3014 | 3051 |
3015 { | 3052 GenerateLoadViaGetter(masm(), getter); |
3016 FrameScope scope(masm(), StackFrame::INTERNAL); | |
3017 | |
3018 // Call the JavaScript getter with the receiver on the stack. | |
3019 __ push(edx); | |
3020 ParameterCount actual(0); | |
3021 __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(), | |
3022 CALL_AS_METHOD); | |
3023 | |
3024 // Restore context register. | |
3025 __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); | |
3026 } | |
3027 __ ret(0); | |
3028 | 3053 |
3029 __ bind(&miss); | 3054 __ bind(&miss); |
3030 GenerateLoadMiss(masm(), Code::LOAD_IC); | 3055 GenerateLoadMiss(masm(), Code::LOAD_IC); |
3031 | 3056 |
3032 // Return the generated code. | 3057 // Return the generated code. |
3033 return GetCode(Code::CALLBACKS, name); | 3058 return GetCode(Code::CALLBACKS, name); |
3034 } | 3059 } |
3035 | 3060 |
3036 | 3061 |
3037 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, | 3062 Handle<Code> LoadStubCompiler::CompileLoadConstant(Handle<JSObject> object, |
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4328 __ jmp(ic_slow, RelocInfo::CODE_TARGET); | 4353 __ jmp(ic_slow, RelocInfo::CODE_TARGET); |
4329 } | 4354 } |
4330 } | 4355 } |
4331 | 4356 |
4332 | 4357 |
4333 #undef __ | 4358 #undef __ |
4334 | 4359 |
4335 } } // namespace v8::internal | 4360 } } // namespace v8::internal |
4336 | 4361 |
4337 #endif // V8_TARGET_ARCH_IA32 | 4362 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |