Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index 8d8d27d08cf1d1a708b0c74a8b13eaef860832d3..d612772d7a0f1dd84f31805abd876f6a8c536352 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -2647,10 +2647,12 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( |
} |
-Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
- Handle<String> name, |
- Handle<JSObject> receiver, |
- Handle<JSObject> holder, |
+#undef __ |
+#define __ ACCESS_MASM(masm) |
+ |
+ |
+void StoreStubCompiler::GenerateStoreViaSetter( |
+ MacroAssembler* masm, |
Handle<JSFunction> setter) { |
// ----------- S t a t e ------------- |
// -- eax : value |
@@ -2658,26 +2660,24 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
// -- edx : receiver |
// -- esp[0] : return address |
// ----------------------------------- |
- Label miss; |
- |
- // Check that the maps haven't changed, preserving the name register. |
- __ push(ecx); |
- __ JumpIfSmi(edx, &miss); |
- CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss); |
- __ pop(ecx); |
- |
{ |
- FrameScope scope(masm(), StackFrame::INTERNAL); |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
// Save value register, so we can restore it later. |
__ push(eax); |
- // Call the JavaScript setter with the receiver and the value on the stack. |
- __ push(edx); |
- __ push(eax); |
- ParameterCount actual(1); |
- __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), |
- CALL_AS_METHOD); |
+ if (!setter.is_null()) { |
+ // Call the JavaScript setter with receiver and value on the stack. |
+ __ push(edx); |
+ __ push(eax); |
+ ParameterCount actual(1); |
+ __ InvokeFunction(setter, actual, CALL_FUNCTION, NullCallWrapper(), |
+ CALL_AS_METHOD); |
+ } else { |
+ // If we generate a global code snippet for deoptimization only, remember |
+ // the place to continue after deoptimization. |
+ masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
+ } |
// We have to return the passed value, not the return value of the setter. |
__ pop(eax); |
@@ -2686,6 +2686,33 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
} |
__ ret(0); |
+} |
+ |
+ |
+#undef __ |
+#define __ ACCESS_MASM(masm()) |
+ |
+ |
+Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
+ Handle<String> name, |
+ Handle<JSObject> receiver, |
+ Handle<JSObject> holder, |
+ Handle<JSFunction> setter) { |
+ // ----------- S t a t e ------------- |
+ // -- eax : value |
+ // -- ecx : name |
+ // -- edx : receiver |
+ // -- esp[0] : return address |
+ // ----------------------------------- |
+ Label miss; |
+ |
+ // Check that the maps haven't changed, preserving the name register. |
+ __ push(ecx); |
+ __ JumpIfSmi(edx, &miss); |
+ CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss); |
+ __ pop(ecx); |
+ |
+ GenerateStoreViaSetter(masm(), setter); |
__ bind(&miss); |
__ pop(ecx); |