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

Unified Diff: src/arm/macro-assembler-arm.cc

Issue 1460503008: [turbofan] Switch passing of new.target to register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_turbofan-pass-new-target-6
Patch Set: Ported to MIPS64. Created 5 years, 1 month 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/arm/macro-assembler-arm.h ('k') | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/macro-assembler-arm.cc
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc
index 744a9c394b567cfed52f41bb2b41291a894f2045..8977d9384aba445338867695bc9d91bd89fe61d5 100644
--- a/src/arm/macro-assembler-arm.cc
+++ b/src/arm/macro-assembler-arm.cc
@@ -1304,6 +1304,7 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected,
void MacroAssembler::InvokeCode(Register code,
+ Register new_target,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
@@ -1311,6 +1312,13 @@ void MacroAssembler::InvokeCode(Register code,
// You can't call a function without a valid frame.
DCHECK(flag == JUMP_FUNCTION || has_frame());
+ // Ensure new target is passed in the correct register. Otherwise clear the
+ // appropriate register in case new target is not given.
+ DCHECK_IMPLIES(new_target.is_valid(), new_target.is(r3));
+ if (!new_target.is_valid()) {
+ LoadRoot(r3, Heap::kUndefinedValueRootIndex);
+ }
+
Label done;
bool definitely_mismatches = false;
InvokePrologue(expected, actual, &done, &definitely_mismatches, flag,
@@ -1333,6 +1341,7 @@ void MacroAssembler::InvokeCode(Register code,
void MacroAssembler::InvokeFunction(Register fun,
+ Register new_target,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper) {
@@ -1343,7 +1352,7 @@ void MacroAssembler::InvokeFunction(Register fun,
DCHECK(fun.is(r1));
Register expected_reg = r2;
- Register code_reg = r3;
+ Register code_reg = r4;
ldr(code_reg, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset));
@@ -1355,7 +1364,7 @@ void MacroAssembler::InvokeFunction(Register fun,
FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
ParameterCount expected(expected_reg);
- InvokeCode(code_reg, expected, actual, flag, call_wrapper);
+ InvokeCode(code_reg, new_target, expected, actual, flag, call_wrapper);
}
@@ -1376,8 +1385,8 @@ void MacroAssembler::InvokeFunction(Register function,
// We call indirectly through the code field in the function to
// allow recompilation to take effect without changing any of the
// call sites.
- ldr(r3, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
- InvokeCode(r3, expected, actual, flag, call_wrapper);
+ ldr(r4, FieldMemOperand(r1, JSFunction::kCodeEntryOffset));
+ InvokeCode(r4, no_reg, expected, actual, flag, call_wrapper);
}
« no previous file with comments | « src/arm/macro-assembler-arm.h ('k') | src/arm64/builtins-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698