Index: src/ic/mips/handler-compiler-mips.cc |
diff --git a/src/ic/mips/handler-compiler-mips.cc b/src/ic/mips/handler-compiler-mips.cc |
index d9dc2b0dc3cbb1ff262263d2ac44c2eb5e27473f..cb394da9a1b5a7af5a8e593e5f4083e47da4a613 100644 |
--- a/src/ic/mips/handler-compiler-mips.cc |
+++ b/src/ic/mips/handler-compiler-mips.cc |
@@ -18,7 +18,8 @@ namespace internal { |
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 ------------- |
// -- a0 : receiver |
// -- a2 : name |
@@ -28,11 +29,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. |
- __ lw(receiver, |
+ __ lw(scratch, |
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
+ receiver = scratch; |
} |
__ push(receiver); |
ParameterCount actual(0); |
@@ -54,7 +58,8 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( |
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 ------------- |
// -- ra : return address |
// ----------------------------------- |
@@ -65,11 +70,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. |
- __ lw(receiver, |
+ __ lw(scratch, |
FieldMemOperand(receiver, JSGlobalObject::kGlobalProxyOffset)); |
+ receiver = scratch; |
} |
__ Push(receiver, value()); |
ParameterCount actual(1); |