Index: src/crankshaft/ppc/lithium-codegen-ppc.cc |
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
index 8f8a0e50f5564c50c4aa311a29435e473cf02d11..847899eb052eaa1068c8df5dd71c764d39296b14 100644 |
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc |
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
@@ -3589,7 +3589,8 @@ void LCodeGen::CallKnownFunction(Handle<JSFunction> function, |
// Change context. |
__ LoadP(cp, FieldMemOperand(function_reg, JSFunction::kContextOffset)); |
- // Always initialize r3 to the number of actual arguments. |
+ // Always initialize new target and number of actual arguments. |
+ __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
__ mov(r3, Operand(arity)); |
bool is_self_call = function.is_identical_to(info()->closure()); |
@@ -4003,11 +4004,13 @@ void LCodeGen::DoCallJSFunction(LCallJSFunction* instr) { |
DCHECK(ToRegister(instr->function()).is(r4)); |
DCHECK(ToRegister(instr->result()).is(r3)); |
- __ mov(r3, Operand(instr->arity())); |
- |
// Change context. |
__ LoadP(cp, FieldMemOperand(r4, JSFunction::kContextOffset)); |
+ // Always initialize new target and number of actual arguments. |
+ __ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
+ __ mov(r3, Operand(instr->arity())); |
+ |
bool is_self_call = false; |
if (instr->hydrogen()->function()->IsConstant()) { |
HConstant* fun_const = HConstant::cast(instr->hydrogen()->function()); |