Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 0caffac10825f999069ef27eb621d8fbd8ed6c1e..5c23a1d96f616895cdcd32ff3870ef541723b698 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -2475,10 +2475,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 ------------- |
// -- rax : value |
@@ -2486,24 +2488,24 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
- Label miss; |
- |
- // Check that the maps haven't changed. |
- __ JumpIfSmi(rdx, &miss); |
- CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss); |
- |
{ |
- FrameScope scope(masm(), StackFrame::INTERNAL); |
+ FrameScope scope(masm, StackFrame::INTERNAL); |
// Save value register, so we can restore it later. |
__ push(rax); |
- // Call the JavaScript setter with the receiver and the value on the stack. |
- __ push(rdx); |
- __ push(rax); |
- 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(rdx); |
+ __ push(rax); |
+ 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(rax); |
@@ -2512,6 +2514,31 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
__ movq(rsi, Operand(rbp, 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 ------------- |
+ // -- rax : value |
+ // -- rcx : name |
+ // -- rdx : receiver |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Label miss; |
+ |
+ // Check that the maps haven't changed. |
+ __ JumpIfSmi(rdx, &miss); |
+ CheckPrototypes(receiver, rdx, holder, rbx, r8, rdi, name, &miss); |
+ |
+ GenerateStoreViaSetter(masm(), setter); |
__ bind(&miss); |
Handle<Code> ic = isolate()->builtins()->StoreIC_Miss(); |