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

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

Issue 2973593002: Revert of Set the current context to the function's context when entering to LAP. (Closed)
Patch Set: Created 3 years, 5 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/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.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 ea069e276e1888e50861ee2406d09f72feed9eae..30fe1e44eb793f061e1b670345eeda27a8a16da5 100644
--- a/src/x64/code-stubs-x64.cc
+++ b/src/x64/code-stubs-x64.cc
@@ -2650,7 +2650,6 @@
// -- ...
// -- rsp[argc * 8] : first argument
// -- rsp[(argc + 1) * 8] : receiver
- // -- rsp[(argc + 2) * 8] : accessor_holder
// -----------------------------------
Register callee = rdi;
@@ -2697,25 +2696,15 @@
// holder
__ Push(holder);
- // enter a new context
- int argc = this->argc();
- if (this->is_lazy()) {
- // load context from accessor_holder
- Register accessor_holder = context;
- __ movp(accessor_holder,
- MemOperand(rsp, (argc + FCA::kArgsLength + 1) * kPointerSize));
- __ movp(scratch, FieldOperand(accessor_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);
+ if (!this->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.
const int kApiStackSpace = 3;
@@ -2723,6 +2712,7 @@
PrepareCallApiFunction(masm, kApiStackSpace);
// FunctionCallbackInfo::implicit_args_.
+ int argc = this->argc();
__ movp(StackSpaceOperand(0), scratch);
__ addp(scratch, Immediate((argc + FCA::kArgsLength - 1) * kPointerSize));
// FunctionCallbackInfo::values_.
@@ -2753,10 +2743,13 @@
ARGUMENTS_DONT_CONTAIN_RECEIVER);
Operand context_restore_operand = args_from_rbp.GetArgumentOperand(
FCA::kArgsLength - FCA::kContextSaveIndex);
+ Operand length_operand = StackSpaceOperand(2);
Operand return_value_operand = args_from_rbp.GetArgumentOperand(
this->is_store() ? 0 : FCA::kArgsLength - FCA::kReturnValueOffset);
- const int stack_space = argc + FCA::kArgsLength + 2;
- Operand* stack_space_operand = nullptr;
+ int stack_space = 0;
+ Operand* stack_space_operand = &length_operand;
+ stack_space = argc + FCA::kArgsLength + 1;
+ stack_space_operand = nullptr;
CallApiFunctionAndReturn(masm, api_function_address, thunk_ref, callback_arg,
stack_space, stack_space_operand,
return_value_operand, &context_restore_operand);
« no previous file with comments | « src/s390/code-stubs-s390.cc ('k') | src/x87/code-stubs-x87.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698