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

Unified Diff: src/x64/builtins-x64.cc

Issue 2106883003: [builtins] Add receiver to builtin exit frames (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comments Created 4 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/mips64/builtins-mips64.cc ('k') | test/message/paren_in_arg_string.out » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/builtins-x64.cc
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
index 45dea848b50a2bc6d0db6db8c1901da6739ece34..4dc001c704a2c17722012fd57c6cc36182441c3e 100644
--- a/src/x64/builtins-x64.cc
+++ b/src/x64/builtins-x64.cc
@@ -35,18 +35,21 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, CFunctionId id,
// ordinary functions).
__ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
- // Unconditionally insert the target and new target as extra arguments. They
+ // JumpToExternalReference expects rax to contain the number of arguments
+ // including the receiver and the extra arguments.
+ const int num_extra_args = 3;
+ __ addp(rax, Immediate(num_extra_args + 1));
+
+ // Unconditionally insert argc, target and new target as extra arguments. They
// will be used by stack frame iterators when constructing the stack trace.
- const int num_extra_args = 2;
__ PopReturnAddressTo(kScratchRegister);
+ __ Integer32ToSmi(rax, rax);
+ __ Push(rax);
+ __ SmiToInteger32(rax, rax);
__ Push(rdi);
__ Push(rdx);
__ PushReturnAddressFrom(kScratchRegister);
- // JumpToExternalReference expects rax to contain the number of arguments
- // including the receiver and the extra arguments.
- __ addp(rax, Immediate(num_extra_args + 1));
-
__ JumpToExternalReference(ExternalReference(id, masm->isolate()),
exit_frame_type == BUILTIN_EXIT);
}
« no previous file with comments | « src/mips64/builtins-mips64.cc ('k') | test/message/paren_in_arg_string.out » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698