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

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

Issue 2770003002: Set the current context to the function's context when entering to LAP. (Closed)
Patch Set: Crashing at cctest test-accessors/AccessorIC 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
Index: src/s390/code-stubs-s390.cc
diff --git a/src/s390/code-stubs-s390.cc b/src/s390/code-stubs-s390.cc
index 9893b12f80ebaed11d467e71003cda92f2978bc1..dc4f901c1581c8e7cbe044e64614cedb3e4f0e20 100644
--- a/src/s390/code-stubs-s390.cc
+++ b/src/s390/code-stubs-s390.cc
@@ -2838,8 +2838,9 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// --
// -- sp[0] : last argument
// -- ...
- // -- sp[(argc - 1)* 4] : first argument
+ // -- sp[(argc - 1) * 4] : first argument
// -- sp[argc * 4] : receiver
+ // -- sp[(argc + 1) * 4] : accessor_holder
// -----------------------------------
Register callee = r2;
@@ -2865,10 +2866,6 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// context save
__ push(context);
- if (!is_lazy()) {
- // load context from callee
- __ LoadP(context, FieldMemOperand(callee, JSFunction::kContextOffset));
- }
// callee
__ push(callee);
@@ -2876,7 +2873,20 @@ void CallApiCallbackStub::Generate(MacroAssembler* masm) {
// call data
__ push(call_data);
+ // Enter a new context
Register scratch = call_data;
+ if (is_lazy()) {
+ // Load context from accessor_holder
+ Register accessor_holder = context;
+ __ LoadP(accessor_holder, MemOperand(sp, (argc() + 1 + 4) * kPointerSize));
+ __ LoadP(scratch, FieldMemOperand(accessor_holder, HeapObject::kMapOffset));
+ __ GetMapConstructor(scratch, scratch, context, callee);
+ __ LoadP(context, FieldMemOperand(scratch, JSFunction::kContextOffset));
+ } else {
+ // Load context from callee
+ __ LoadP(context, FieldMemOperand(callee, JSFunction::kContextOffset));
+ }
+
__ LoadRoot(scratch, Heap::kUndefinedValueRootIndex);
// return value
__ push(scratch);

Powered by Google App Engine
This is Rietveld 408576698