Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 9d9591b69fe912f213eeddc6824172b2128ea46f..939485d55a2459b5ce9d7a8c25d92c2a55250694 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -3636,24 +3636,20 @@ void LCodeGen::DoDeclareGlobals(LDeclareGlobals* instr) { |
void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
- int formal_parameter_count, |
- int arity, |
- LInstruction* instr, |
- R1State r1_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 = r1; |
+ |
LPointerMap* pointers = instr->pointer_map(); |
if (can_invoke_directly) { |
- if (r1_state == R1_UNINITIALIZED) { |
- __ Move(r1, function); |
- } |
- |
// Change context. |
- __ ldr(cp, FieldMemOperand(r1, JSFunction::kContextOffset)); |
+ __ ldr(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
// Set r0 to arguments count if adaption is not needed. Assumes that r0 |
// is available to write to at this point. |
@@ -3662,7 +3658,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
} |
// Invoke function. |
- __ ldr(ip, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
+ __ ldr(ip, FieldMemOperand(function_reg, JSFunction::kCodeEntryOffset)); |
__ Call(ip); |
// Set up deoptimization. |
@@ -3671,7 +3667,7 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
SafepointGenerator generator(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); |
} |
} |
@@ -3973,9 +3969,7 @@ void LCodeGen::DoInvokeFunction(LInvokeFunction* instr) { |
} else { |
CallKnownFunction(known_function, |
instr->hydrogen()->formal_parameter_count(), |
- instr->arity(), |
- instr, |
- R1_CONTAINS_TARGET); |
+ instr->arity(), instr); |
} |
} |