Index: src/ia32/stub-cache-ia32.cc |
diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
index d205ccb78903e1a7f4b198e188af7a0fd51ae933..50a22129fe64efab5427a6e3cf7589e929bafe38 100644 |
--- a/src/ia32/stub-cache-ia32.cc |
+++ b/src/ia32/stub-cache-ia32.cc |
@@ -276,12 +276,12 @@ void StubCompiler::GenerateDirectLoadGlobalFunctionPrototype( |
Register prototype, |
Label* miss) { |
// Check we're still in the same context. |
- __ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX)), |
- masm->isolate()->global_object()); |
+ __ cmp(Operand(esi, Context::SlotOffset(Context::GLOBAL_INDEX)), |
+ masm->isolate()->global()); |
__ j(not_equal, miss); |
// Get the global function with the given index. |
Handle<JSFunction> function( |
- JSFunction::cast(masm->isolate()->native_context()->get(index))); |
+ JSFunction::cast(masm->isolate()->global_context()->get(index))); |
// Load its initial map. The global functions all have initial maps. |
__ Set(prototype, Immediate(Handle<Map>(function->initial_map()))); |
// Load the prototype from the initial map. |
@@ -2647,12 +2647,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 ------------- |
// -- eax : value |
@@ -2660,24 +2658,26 @@ void StoreStubCompiler::GenerateStoreViaSetter( |
// -- edx : receiver |
// -- esp[0] : return address |
// ----------------------------------- |
+ Label miss; |
+ |
+ // Check that the maps haven't changed, preserving the name register. |
+ __ push(ecx); |
+ __ JumpIfSmi(edx, &miss); |
+ CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss); |
+ __ pop(ecx); |
+ |
{ |
- FrameScope scope(masm, StackFrame::INTERNAL); |
+ FrameScope scope(masm(), StackFrame::INTERNAL); |
// Save value register, so we can restore it later. |
__ push(eax); |
- if (!setter.is_null()) { |
- // Call the JavaScript setter with receiver and value on the stack. |
- __ push(edx); |
- __ push(eax); |
- 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(edx); |
+ __ push(eax); |
+ 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(eax); |
@@ -2686,33 +2686,6 @@ void StoreStubCompiler::GenerateStoreViaSetter( |
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
} |
__ ret(0); |
-} |
- |
- |
-#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 ------------- |
- // -- eax : value |
- // -- ecx : name |
- // -- edx : receiver |
- // -- esp[0] : return address |
- // ----------------------------------- |
- Label miss; |
- |
- // Check that the maps haven't changed, preserving the name register. |
- __ push(ecx); |
- __ JumpIfSmi(edx, &miss); |
- CheckPrototypes(receiver, edx, holder, ebx, ecx, edi, name, &miss); |
- __ pop(ecx); |
- |
- GenerateStoreViaSetter(masm(), setter); |
__ bind(&miss); |
__ pop(ecx); |