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

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

Issue 1491883002: [builtins] Some refactoring on the builtin mechanism. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/builtins-x87.cc
diff --git a/src/x87/builtins-x87.cc b/src/x87/builtins-x87.cc
index 185a9a62dd84253775f039ab28baed7ae4ff5e87..9ee0da85c834c8a0a7898844c7cad1ab4074469e 100644
--- a/src/x87/builtins-x87.cc
+++ b/src/x87/builtins-x87.cc
@@ -22,7 +22,8 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
BuiltinExtraArguments extra_args) {
// ----------- S t a t e -------------
// -- eax : number of arguments excluding receiver
- // -- edi : called function
+ // -- edi : target
+ // -- edx : new.target
// -- esp[0] : return address
// -- esp[4] : last argument
// -- ...
@@ -33,14 +34,17 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm,
// Insert extra arguments.
int num_extra_args = 0;
- if (extra_args == NEEDS_CALLED_FUNCTION) {
- num_extra_args = 1;
- Register scratch = ebx;
- __ pop(scratch); // Save return address.
- __ push(edi);
- __ push(scratch); // Restore return address.
- } else {
- DCHECK(extra_args == NO_EXTRA_ARGUMENTS);
+ if (extra_args != BuiltinExtraArguments::kNone) {
+ __ PopReturnAddressTo(ecx);
+ if (extra_args & BuiltinExtraArguments::kTarget) {
+ ++num_extra_args;
+ __ Push(edi);
+ }
+ if (extra_args & BuiltinExtraArguments::kNewTarget) {
+ ++num_extra_args;
+ __ Push(edx);
+ }
+ __ PushReturnAddressFrom(ecx);
}
// JumpToExternalReference expects eax to contain the number of arguments
« no previous file with comments | « src/x64/builtins-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698