Index: src/mips/stub-cache-mips.cc |
diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc |
index afa2bfdd3763bc3ddd0c32a3e899a4dcb9a3b0c2..2c24da5eeb64929aa2502c3b1f181cffc53b7399 100644 |
--- a/src/mips/stub-cache-mips.cc |
+++ b/src/mips/stub-cache-mips.cc |
@@ -270,12 +270,11 @@ void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, |
int index, |
Register prototype) { |
// Load the global or builtins object from the current context. |
+ __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
+ // Load the global context from the global or builtins object. |
__ lw(prototype, |
- MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
- // Load the native context from the global or builtins object. |
- __ lw(prototype, |
- FieldMemOperand(prototype, GlobalObject::kNativeContextOffset)); |
- // Load the function from the native context. |
+ FieldMemOperand(prototype, GlobalObject::kGlobalContextOffset)); |
+ // Load the function from the global context. |
__ lw(prototype, MemOperand(prototype, Context::SlotOffset(index))); |
// Load the initial map. The global functions all have initial maps. |
__ lw(prototype, |
@@ -292,14 +291,13 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
Label* miss) { |
Isolate* isolate = masm->isolate(); |
// Check we're still in the same context. |
- __ lw(prototype, |
- MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
+ __ lw(prototype, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_INDEX))); |
ASSERT(!prototype.is(at)); |
- __ li(at, isolate->global_object()); |
+ __ li(at, isolate->global()); |
__ Branch(miss, ne, prototype, Operand(at)); |
// 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. |
__ li(prototype, Handle<Map>(function->initial_map())); |
// Load the prototype from the initial map. |
@@ -2720,12 +2718,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 ------------- |
// -- a0 : value |
@@ -2733,24 +2729,24 @@ void StoreStubCompiler::GenerateStoreViaSetter( |
// -- a2 : name |
// -- ra : return address |
// ----------------------------------- |
+ Label miss; |
+ |
+ // Check that the maps haven't changed. |
+ __ JumpIfSmi(a1, &miss); |
+ CheckPrototypes(receiver, a1, holder, a3, t0, t1, name, &miss); |
+ |
{ |
- FrameScope scope(masm, StackFrame::INTERNAL); |
+ FrameScope scope(masm(), StackFrame::INTERNAL); |
// Save value register, so we can restore it later. |
__ push(a0); |
- if (!setter.is_null()) { |
- // Call the JavaScript setter with receiver and value on the stack. |
- __ push(a1); |
- __ push(a0); |
- 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(a1); |
+ __ push(a0); |
+ 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(v0); |
@@ -2759,31 +2755,6 @@ void StoreStubCompiler::GenerateStoreViaSetter( |
__ lw(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 ------------- |
- // -- a0 : value |
- // -- a1 : receiver |
- // -- a2 : name |
- // -- ra : return address |
- // ----------------------------------- |
- Label miss; |
- |
- // Check that the maps haven't changed. |
- __ JumpIfSmi(a1, &miss); |
- CheckPrototypes(receiver, a1, holder, a3, t0, t1, name, &miss); |
- |
- GenerateStoreViaSetter(masm(), setter); |
__ bind(&miss); |
Handle<Code> ic = masm()->isolate()->builtins()->StoreIC_Miss(); |