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); |
} |
} |