Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index da4f4b95718d1db9607e3f1ac02369d154a8bf82..a85056252e212eb32a30839bde2e2a0af3e89b69 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -2715,10 +2715,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 ------------- |
// -- r0 : value |
@@ -2726,23 +2728,23 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
// -- r2 : name |
// -- lr : return address |
// ----------------------------------- |
- Label miss; |
- |
- // Check that the maps haven't changed. |
- __ JumpIfSmi(r1, &miss); |
- CheckPrototypes(receiver, r1, holder, r3, r4, r5, name, &miss); |
- |
{ |
- FrameScope scope(masm(), StackFrame::INTERNAL); |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
// Save value register, so we can restore it later. |
__ push(r0); |
- // Call the JavaScript setter with the receiver and the value on the stack. |
- __ Push(r1, r0); |
- 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(r1, r0); |
+ 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(r0); |
@@ -2751,6 +2753,31 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
} |
__ Ret(); |
+} |
+ |
+ |
+#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 ------------- |
+ // -- r0 : value |
+ // -- r1 : receiver |
+ // -- r2 : name |
+ // -- lr : return address |
+ // ----------------------------------- |
+ Label miss; |
+ |
+ // Check that the maps haven't changed. |
+ __ JumpIfSmi(r1, &miss); |
+ CheckPrototypes(receiver, r1, holder, r3, r4, r5, name, &miss); |
+ |
+ GenerateStoreViaSetter(masm(), setter); |
__ bind(&miss); |
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |