| Index: src/x64/stub-cache-x64.cc
|
| diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc
|
| index cb6198ac0dedb8220667dcd0ca4506e9b04de6c7..cd71086eecf7a5a41733064d244df1e5815bdb46 100644
|
| --- a/src/x64/stub-cache-x64.cc
|
| +++ b/src/x64/stub-cache-x64.cc
|
| @@ -2819,6 +2819,43 @@ Handle<Code> LoadStubCompiler::CompileLoadCallback(
|
| }
|
|
|
|
|
| +#undef __
|
| +#define __ ACCESS_MASM(masm)
|
| +
|
| +
|
| +void LoadStubCompiler::GenerateLoadViaGetter(MacroAssembler* masm,
|
| + Handle<JSFunction> getter) {
|
| + // ----------- S t a t e -------------
|
| + // -- rax : receiver
|
| + // -- rcx : name
|
| + // -- rsp[0] : return address
|
| + // -----------------------------------
|
| + {
|
| + FrameScope scope(masm, StackFrame::INTERNAL);
|
| +
|
| + if (!getter.is_null()) {
|
| + // Call the JavaScript getter with the receiver on the stack.
|
| + __ push(rax);
|
| + ParameterCount actual(0);
|
| + __ InvokeFunction(getter, 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()->SetGetterStubDeoptPCOffset(masm->pc_offset());
|
| + }
|
| +
|
| + // Restore context register.
|
| + __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
| + }
|
| + __ ret(0);
|
| +}
|
| +
|
| +
|
| +#undef __
|
| +#define __ ACCESS_MASM(masm())
|
| +
|
| +
|
| Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
|
| Handle<String> name,
|
| Handle<JSObject> receiver,
|
| @@ -2835,19 +2872,7 @@ Handle<Code> LoadStubCompiler::CompileLoadViaGetter(
|
| __ JumpIfSmi(rax, &miss);
|
| CheckPrototypes(receiver, rax, holder, rbx, rdx, rdi, name, &miss);
|
|
|
| - {
|
| - FrameScope scope(masm(), StackFrame::INTERNAL);
|
| -
|
| - // Call the JavaScript getter with the receiver on the stack.
|
| - __ push(rax);
|
| - ParameterCount actual(0);
|
| - __ InvokeFunction(getter, actual, CALL_FUNCTION, NullCallWrapper(),
|
| - CALL_AS_METHOD);
|
| -
|
| - // Restore context register.
|
| - __ movq(rsi, Operand(rbp, StandardFrameConstants::kContextOffset));
|
| - }
|
| - __ ret(0);
|
| + GenerateLoadViaGetter(masm(), getter),
|
|
|
| __ bind(&miss);
|
| GenerateLoadMiss(masm(), Code::LOAD_IC);
|
|
|