| Index: src/arm/stub-cache-arm.cc
 | 
| diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc
 | 
| index 86c247f61a7477cd8d82f55bc84c473dc45c6a03..80ede14e221e9bd25793ee3fd7a4e3cab468fd5c 100644
 | 
| --- a/src/arm/stub-cache-arm.cc
 | 
| +++ b/src/arm/stub-cache-arm.cc
 | 
| @@ -283,12 +283,11 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
 | 
|                                                         int index,
 | 
|                                                         Register prototype) {
 | 
|    // Load the global or builtins object from the current context.
 | 
| +  __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
 | 
| +  // Load the global context from the global or builtins object.
 | 
|    __ ldr(prototype,
 | 
| -         MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
 | 
| -  // Load the native context from the global or builtins object.
 | 
| -  __ ldr(prototype,
 | 
| -         FieldMemOperand(prototype, GlobalObject::kNativeContextOffset));
 | 
| -  // Load the function from the native context.
 | 
| +         FieldMemOperand(prototype, GlobalObject::kGlobalContextOffset));
 | 
| +  // Load the function from the global context.
 | 
|    __ ldr(prototype, MemOperand(prototype, Context::SlotOffset(index)));
 | 
|    // Load the initial map.  The global functions all have initial maps.
 | 
|    __ ldr(prototype,
 | 
| @@ -305,14 +304,13 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype(
 | 
|      Label* miss) {
 | 
|    Isolate* isolate = masm->isolate();
 | 
|    // Check we're still in the same context.
 | 
| -  __ ldr(prototype,
 | 
| -         MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)));
 | 
| -  __ Move(ip, isolate->global_object());
 | 
| +  __ ldr(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX)));
 | 
| +  __ Move(ip, isolate->global());
 | 
|    __ cmp(prototype, ip);
 | 
|    __ b(ne, miss);
 | 
|    // Get the global function with the given index.
 | 
|    Handle<JSFunction> function(
 | 
| -      JSFunction::cast(isolate->native_context()->get(index)));
 | 
| +      JSFunction::cast(isolate->global_context()->get(index)));
 | 
|    // Load its initial map. The global functions all have initial maps.
 | 
|    __ Move(prototype, Handle<Map>(function->initial_map()));
 | 
|    // Load the prototype from the initial map.
 | 
| @@ -2717,12 +2715,10 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback(
 | 
|  }
 | 
|  
 | 
|  
 | 
| -#undef __
 | 
| -#define __ ACCESS_MASM(masm)
 | 
| -
 | 
| -
 | 
| -void StoreStubCompiler::GenerateStoreViaSetter(
 | 
| -    MacroAssembler* masm,
 | 
| +Handle<Code> StoreStubCompiler::CompileStoreViaSetter(
 | 
| +    Handle<String> name,
 | 
| +    Handle<JSObject> receiver,
 | 
| +    Handle<JSObject> holder,
 | 
|      Handle<JSFunction> setter) {
 | 
|    // ----------- S t a t e -------------
 | 
|    //  -- r0    : value
 | 
| @@ -2730,23 +2726,23 @@ void StoreStubCompiler::GenerateStoreViaSetter(
 | 
|    //  -- 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);
 | 
|  
 | 
| -    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());
 | 
| -    }
 | 
| +    // 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);
 | 
|  
 | 
|      // We have to return the passed value, not the return value of the setter.
 | 
|      __ pop(r0);
 | 
| @@ -2755,31 +2751,6 @@ void StoreStubCompiler::GenerateStoreViaSetter(
 | 
|      __ 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();
 | 
| 
 |