Index: src/mips/builtins-mips.cc |
diff --git a/src/mips/builtins-mips.cc b/src/mips/builtins-mips.cc |
index 5f3d3e20129744aff217835b5c0f5ec259b930e2..b4c2f8dcab4872b0a86530a26fcab217159f1e10 100644 |
--- a/src/mips/builtins-mips.cc |
+++ b/src/mips/builtins-mips.cc |
@@ -23,7 +23,8 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
BuiltinExtraArguments extra_args) { |
// ----------- S t a t e ------------- |
// -- a0 : number of arguments excluding receiver |
- // -- a1 : called function |
+ // -- a1 : target |
+ // -- a3 : new.target |
// -- sp[0] : last argument |
// -- ... |
// -- sp[4 * (argc - 1)] : first argument |
@@ -33,11 +34,21 @@ void Builtins::Generate_Adaptor(MacroAssembler* masm, |
// Insert extra arguments. |
int num_extra_args = 0; |
- if (extra_args == NEEDS_CALLED_FUNCTION) { |
- num_extra_args = 1; |
- __ push(a1); |
- } else { |
- DCHECK(extra_args == NO_EXTRA_ARGUMENTS); |
+ switch (extra_args) { |
+ case BuiltinExtraArguments::kTarget: |
+ __ Push(a1); |
+ ++num_extra_args; |
+ break; |
+ case BuiltinExtraArguments::kNewTarget: |
+ __ Push(a3); |
+ ++num_extra_args; |
+ break; |
+ case BuiltinExtraArguments::kTargetAndNewTarget: |
+ __ Push(a1, a3); |
+ num_extra_args += 2; |
+ break; |
+ case BuiltinExtraArguments::kNone: |
+ break; |
} |
// JumpToExternalReference expects a0 to contain the number of arguments |