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

Unified Diff: src/x64/lithium-codegen-x64.cc

Issue 817483005: LCodeGen::CallKnownFunction gets the function in register. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix arm Created 5 years, 11 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/x64/lithium-codegen-x64.h ('k') | src/x87/lithium-codegen-x87.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index 10f2bb8cdd27a7dbeb80c86f549e83ccac6bc0ae..8e1f65c771800d5e501d0e8989dc9af8b9741ca2 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -3490,24 +3490,19 @@ void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) {
void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
- int formal_parameter_count,
- int arity,
- LInstruction* instr,
- RDIState rdi_state) {
+ int formal_parameter_count, int arity,
+ LInstruction* instr) {
bool dont_adapt_arguments =
formal_parameter_count == SharedFunctionInfo::kDontAdaptArgumentsSentinel;
bool can_invoke_directly =
dont_adapt_arguments || formal_parameter_count == arity;
+ Register function_reg = rdi;
LPointerMap* pointers = instr->pointer_map();
if (can_invoke_directly) {
- if (rdi_state == RDI_UNINITIALIZED) {
- __ Move(rdi, function);
- }
-
// Change context.
- __ movp(rsi, FieldOperand(rdi, JSFunction::kContextOffset));
+ __ movp(rsi, FieldOperand(function_reg, JSFunction::kContextOffset));
// Set rax to arguments count if adaption is not needed. Assumes that rax
// is available to write to at this point.
@@ -3519,7 +3514,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
if (function.is_identical_to(info()->closure())) {
__ CallSelf();
} else {
- __ Call(FieldOperand(rdi, JSFunction::kCodeEntryOffset));
+ __ Call(FieldOperand(function_reg, JSFunction::kCodeEntryOffset));
}
// Set up deoptimization.
@@ -3530,7 +3525,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function,
this, pointers, Safepoint::kLazyDeopt);
ParameterCount count(arity);
ParameterCount expected(formal_parameter_count);
- __ InvokeFunction(function, expected, count, CALL_FUNCTION, generator);
+ __ InvokeFunction(function_reg, expected, count, CALL_FUNCTION, generator);
}
}
@@ -4020,9 +4015,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) {
} else {
CallKnownFunction(known_function,
instr->hydrogen()->formal_parameter_count(),
- instr->arity(),
- instr,
- RDI_CONTAINS_TARGET);
+ instr->arity(), instr);
}
}
« no previous file with comments | « src/x64/lithium-codegen-x64.h ('k') | src/x87/lithium-codegen-x87.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698