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

Unified Diff: src/x64/macro-assembler-x64.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/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/macro-assembler-x64.cc
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc
index 6ee167ebe3968f9c328de9f6a69bb6b279183b59..fbbc0688e1ce2453a35c66d797d221059f867d6f 100644
--- a/src/x64/macro-assembler-x64.cc
+++ b/src/x64/macro-assembler-x64.cc
@@ -707,8 +707,8 @@ void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag,
// arguments match the expected number of arguments. Fake a
// parameter count to avoid emitting code to do the check.
ParameterCount expected(0);
- GetBuiltinEntry(rdx, native_context_index);
- InvokeCode(rdx, expected, expected, flag, call_wrapper);
+ GetBuiltinEntry(r8, native_context_index);
+ InvokeCode(r8, no_reg, expected, expected, flag, call_wrapper);
}
@@ -3976,15 +3976,16 @@ void MacroAssembler::DebugBreak() {
void MacroAssembler::InvokeFunction(Register function,
+ Register new_target,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper) {
- movp(rdx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
+ movp(rbx, FieldOperand(function, JSFunction::kSharedFunctionInfoOffset));
LoadSharedFunctionInfoSpecialField(
- rbx, rdx, SharedFunctionInfo::kFormalParameterCountOffset);
+ rbx, rbx, SharedFunctionInfo::kFormalParameterCountOffset);
ParameterCount expected(rbx);
- InvokeFunction(function, expected, actual, flag, call_wrapper);
+ InvokeFunction(function, new_target, expected, actual, flag, call_wrapper);
}
@@ -3994,25 +3995,27 @@ void MacroAssembler::InvokeFunction(Handle<JSFunction> function,
InvokeFlag flag,
const CallWrapper& call_wrapper) {
Move(rdi, function);
- InvokeFunction(rdi, expected, actual, flag, call_wrapper);
+ InvokeFunction(rdi, no_reg, expected, actual, flag, call_wrapper);
}
void MacroAssembler::InvokeFunction(Register function,
+ Register new_target,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
const CallWrapper& call_wrapper) {
DCHECK(function.is(rdi));
movp(rsi, FieldOperand(function, JSFunction::kContextOffset));
- // Advances rdx to the end of the Code object header, to the start of
+ // Advances r8 to the end of the Code object header, to the start of
// the executable code.
- movp(rdx, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
- InvokeCode(rdx, expected, actual, flag, call_wrapper);
+ movp(r8, FieldOperand(rdi, JSFunction::kCodeEntryOffset));
+ InvokeCode(r8, new_target, expected, actual, flag, call_wrapper);
}
void MacroAssembler::InvokeCode(Register code,
+ Register new_target,
const ParameterCount& expected,
const ParameterCount& actual,
InvokeFlag flag,
@@ -4020,6 +4023,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(rdx));
+ if (!new_target.is_valid()) {
+ LoadRoot(rdx, Heap::kUndefinedValueRootIndex);
+ }
+
Label done;
bool definitely_mismatches = false;
InvokePrologue(expected,
« no previous file with comments | « src/x64/macro-assembler-x64.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698