Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: src/ic/x64/handler-compiler-x64.cc

Issue 2770003002: Set the current context to the function's context when entering to LAP. (Closed)
Patch Set: Attempt to get the context in PropertyHandlerCompiler::GenerateApiAccessorCall (NOT WORKING) Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/x64/code-stubs-x64.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/x64/handler-compiler-x64.cc
diff --git a/src/ic/x64/handler-compiler-x64.cc b/src/ic/x64/handler-compiler-x64.cc
index feea10360f51ec0b54239ccbff2a9504684562cb..466b04e9a18161e38389b7b49edbe35fdba28419 100644
--- a/src/ic/x64/handler-compiler-x64.cc
+++ b/src/ic/x64/handler-compiler-x64.cc
@@ -109,7 +109,7 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
Register data = rbx;
Register holder = rcx;
Register api_function_address = rdx;
- scratch = no_reg;
+ Register context = rsi;
// Put callee in place.
__ LoadAccessor(callee, accessor_holder, accessor_index,
@@ -155,8 +155,20 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ Move(api_function_address, function_address,
RelocInfo::EXTERNAL_REFERENCE);
+ // Put context in place.
+ const bool is_lazy = !optimization.is_constant_call();
+ if (is_lazy) {
+ // load context from holder
+ __ movp(scratch, FieldOperand(holder, HeapObject::kMapOffset));
+ __ GetMapConstructor(scratch, scratch, context);
+ __ movp(context, FieldOperand(scratch, JSFunction::kContextOffset));
+ } else {
+ // load context from callee
+ __ movp(context, FieldOperand(callee, JSFunction::kContextOffset));
+ }
+
// Jump to stub.
- CallApiCallbackStub stub(isolate, is_store, !optimization.is_constant_call());
+ CallApiCallbackStub stub(isolate, is_store, is_lazy);
__ TailCallStub(&stub);
}
« no previous file with comments | « no previous file | src/objects.cc » ('j') | src/x64/code-stubs-x64.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698