Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index ca6305246f7c5882526bd1a2e9a59a226cda6b1c..694a4ed68f25b81d144555a961f6fba6b5676f26 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -1284,6 +1284,7 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( |
void StoreStubCompiler::GenerateStoreViaSetter( |
MacroAssembler* masm, |
+ Handle<HeapType> type, |
Handle<JSFunction> setter) { |
// ----------- S t a t e ------------- |
// -- r0 : value |
@@ -1293,13 +1294,21 @@ void StoreStubCompiler::GenerateStoreViaSetter( |
// ----------------------------------- |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
+ Register receiver = r1; |
+ Register value = r0; |
// Save value register, so we can restore it later. |
- __ push(r0); |
+ __ push(value); |
if (!setter.is_null()) { |
// Call the JavaScript setter with receiver and value on the stack. |
- __ Push(r1, r0); |
+ if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
+ // Swap in the global receiver. |
+ __ ldr(receiver, |
+ FieldMemOperand( |
+ receiver, JSGlobalObject::kGlobalReceiverOffset)); |
+ } |
+ __ Push(receiver, value); |
ParameterCount actual(1); |
ParameterCount expected(setter); |
__ InvokeFunction(setter, expected, actual, |
@@ -1406,6 +1415,7 @@ Register* KeyedStoreStubCompiler::registers() { |
void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
+ Handle<HeapType> type, |
Register receiver, |
Handle<JSFunction> getter) { |
// ----------- S t a t e ------------- |
@@ -1418,6 +1428,12 @@ void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm, |
if (!getter.is_null()) { |
// Call the JavaScript getter with the receiver on the stack. |
+ if (IC::TypeToMap(*type, masm->isolate())->IsJSGlobalObjectMap()) { |
+ // Swap in the global receiver. |
+ __ ldr(receiver, |
+ FieldMemOperand( |
+ receiver, JSGlobalObject::kGlobalReceiverOffset)); |
+ } |
__ push(receiver); |
ParameterCount actual(0); |
ParameterCount expected(getter); |