Chromium Code Reviews| Index: src/ia32/stub-cache-ia32.cc |
| diff --git a/src/ia32/stub-cache-ia32.cc b/src/ia32/stub-cache-ia32.cc |
| index 50a22129fe64efab5427a6e3cf7589e929bafe38..d98b76fcf4d2a589954f907cd00772f981ca4058 100644 |
| --- a/src/ia32/stub-cache-ia32.cc |
| +++ b/src/ia32/stub-cache-ia32.cc |
| @@ -2647,10 +2647,12 @@ Handle<Code> StoreStubCompiler::CompileStoreCallback( |
| } |
| -Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| - Handle<String> name, |
| - Handle<JSObject> receiver, |
| - Handle<JSObject> holder, |
| +#undef __ |
| +#define __ ACCESS_MASM(masm) |
| + |
| + |
| +void StoreStubCompiler::GenerateStoreViaSetter( |
| + MacroAssembler* masm, |
| Handle<JSFunction> setter) { |
| // ----------- S t a t e ------------- |
| // -- eax : value |
| @@ -2658,26 +2660,24 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| // -- 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); |
| - // 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); |
| + if (setter.is_null()) { |
|
Michael Starzinger
2012/08/16 17:20:04
Can we flip the condition, thereby the return poin
Sven Panne
2012/08/17 07:27:26
Good point. Done here and on other platforms.
|
| + // If we generate a global code snippet for deoptimization only, remember |
| + // the place to continue after deoptimization. |
| + masm->isolate()->heap()->SetSetterStubDeoptPCOffset(masm->pc_offset()); |
| + } else { |
| + // 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); |
| + } |
| // We have to return the passed value, not the return value of the setter. |
| __ pop(eax); |
| @@ -2686,6 +2686,33 @@ Handle<Code> StoreStubCompiler::CompileStoreViaSetter( |
| __ 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); |