Index: src/ic/x64/handler-compiler-x64.cc |
diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc |
index 38754a94a0a86557e15453fd250007d05fe25344..d2ee3aaf4429e0b566266676d61bea8374f00146 100644 |
--- a/src/ic/x64/handler-compiler-x64.cc |
+++ b/src/ic/x64/handler-compiler-x64.cc |
@@ -214,7 +214,8 @@ void PropertyHandlerCompiler::GenerateCheckPropertyCell( |
void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
- Register holder, int accessor_index, int expected_arguments) { |
+ Register holder, int accessor_index, int expected_arguments, |
+ Register scratch) { |
// ----------- S t a t e ------------- |
// -- rsp[0] : return address |
// ----------------------------------- |
@@ -225,11 +226,15 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
__ Push(value()); |
if (accessor_index >= 0) { |
+ DCHECK(!holder.is(scratch)); |
+ DCHECK(!receiver.is(scratch)); |
+ DCHECK(!value().is(scratch)); |
// Call the JavaScript setter with receiver and value on the stack. |
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
// Swap in the global receiver. |
- __ movp(receiver, |
+ __ movp(scratch, |
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
+ receiver = scratch; |
} |
__ Push(receiver); |
__ Push(value()); |
@@ -256,7 +261,8 @@ void NamedStoreHandlerCompiler::GenerateStoreViaSetter( |
void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
MacroAssembler* masm, Handle<HeapType> type, Register receiver, |
- Register holder, int accessor_index, int expected_arguments) { |
+ Register holder, int accessor_index, int expected_arguments, |
+ Register scratch) { |
// ----------- S t a t e ------------- |
// -- rax : receiver |
// -- rcx : name |
@@ -266,11 +272,14 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
FrameScope scope(masm, StackFrame::INTERNAL); |
if (accessor_index >= 0) { |
+ DCHECK(!holder.is(scratch)); |
+ DCHECK(!receiver.is(scratch)); |
// Call the JavaScript getter with the receiver on the stack. |
if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
// Swap in the global receiver. |
- __ movp(receiver, |
+ __ movp(scratch, |
FieldOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
+ receiver = scratch; |
} |
__ Push(receiver); |
ParameterCount actual(0); |