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

Unified Diff: src/x64/code-stubs-x64.cc

Issue 2770003002: Set the current context to the function's context when entering to LAP. (Closed)
Patch Set: Made the unittest a little milder (not test a corner case). 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 | « src/objects.cc ('k') | test/unittests/api/v8-object-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/code-stubs-x64.cc
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc
index 84630928d49ee3a256af73a9a2268d49e029d49c..e2b7b96689d467e1e85004288907283927381c49 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2755,15 +2755,20 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// holder
__ Push(holder);
- __ movp(scratch, rsp);
- // Push return address back on stack.
- __ PushReturnAddressFrom(return_address);
-
- if (!this->is_lazy()) {
+ if (this->is_lazy()) {
jochen (gone - plz use gerrit) 2017/06/14 09:26:01 maybe we can just enter the correct context before
Yuki 2017/06/14 13:34:52 I gave it a shot in PS8, but I failed so far. Cou
+ // 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));
}
+ __ movp(scratch, rsp);
+ // Push return address back on stack.
+ __ PushReturnAddressFrom(return_address);
+
// Allocate the v8::Arguments structure in the arguments' space since
// it's not controlled by GC.
const int kApiStackSpace = 3;
« no previous file with comments | « src/objects.cc ('k') | test/unittests/api/v8-object-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698