Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 7f976940b5a2213e505c3af0005405d9efb1dc8b..b09277252b0d426ecf8806f706cbb797966984f3 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -5216,7 +5216,7 @@ static void CallApiFunctionAndReturn(MacroAssembler* masm, |
static void CallApiFunctionStubHelper(MacroAssembler* masm, |
const ParameterCount& argc, |
bool return_first_arg, |
- bool call_data_undefined) { |
+ bool call_data_undefined, bool is_lazy) { |
// ----------- S t a t e ------------- |
// -- rdi : callee |
// -- rbx : call_data |
@@ -5279,8 +5279,10 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm, |
// Push return address back on stack. |
__ PushReturnAddressFrom(return_address); |
- // load context from callee |
- __ movp(context, FieldOperand(callee, JSFunction::kContextOffset)); |
+ if (!is_lazy) { |
+ // load context from callee |
+ __ movp(context, FieldOperand(callee, JSFunction::kContextOffset)); |
+ } |
// Allocate the v8::Arguments structure in the arguments' space since |
// it's not controlled by GC. |
@@ -5353,7 +5355,7 @@ static void CallApiFunctionStubHelper(MacroAssembler* masm, |
void CallApiFunctionStub::Generate(MacroAssembler* masm) { |
bool call_data_undefined = this->call_data_undefined(); |
CallApiFunctionStubHelper(masm, ParameterCount(rax), false, |
- call_data_undefined); |
+ call_data_undefined, false); |
} |
@@ -5361,8 +5363,9 @@ void CallApiAccessorStub::Generate(MacroAssembler* masm) { |
bool is_store = this->is_store(); |
int argc = this->argc(); |
bool call_data_undefined = this->call_data_undefined(); |
+ bool is_lazy = this->is_lazy(); |
CallApiFunctionStubHelper(masm, ParameterCount(argc), is_store, |
- call_data_undefined); |
+ call_data_undefined, is_lazy); |
} |