Index: src/ppc/macro-assembler-ppc.cc |
diff --git a/src/ppc/macro-assembler-ppc.cc b/src/ppc/macro-assembler-ppc.cc |
index 88ca14977a585ff3921400967c8333494f5dfbbe..17473479fad76612902759e9a0ea3b8d7434b1c1 100644 |
--- a/src/ppc/macro-assembler-ppc.cc |
+++ b/src/ppc/macro-assembler-ppc.cc |
@@ -1085,12 +1085,20 @@ void MacroAssembler::InvokePrologue(const ParameterCount& expected, |
} |
-void MacroAssembler::InvokeCode(Register code, const ParameterCount& expected, |
+void MacroAssembler::InvokeCode(Register code, Register new_target, |
+ const ParameterCount& expected, |
const ParameterCount& actual, InvokeFlag flag, |
const CallWrapper& call_wrapper) { |
// 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(r6)); |
+ if (!new_target.is_valid()) { |
+ LoadRoot(r6, Heap::kUndefinedValueRootIndex); |
+ } |
+ |
Label done; |
bool definitely_mismatches = false; |
InvokePrologue(expected, actual, &done, &definitely_mismatches, flag, |
@@ -1112,7 +1120,8 @@ void MacroAssembler::InvokeCode(Register code, const ParameterCount& expected, |
} |
-void MacroAssembler::InvokeFunction(Register fun, const ParameterCount& actual, |
+void MacroAssembler::InvokeFunction(Register fun, Register new_target, |
+ const ParameterCount& actual, |
InvokeFlag flag, |
const CallWrapper& call_wrapper) { |
// You can't call a function without a valid frame. |
@@ -1135,7 +1144,7 @@ void MacroAssembler::InvokeFunction(Register fun, const ParameterCount& actual, |
LoadP(code_reg, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); |
ParameterCount expected(expected_reg); |
- InvokeCode(code_reg, expected, actual, flag, call_wrapper); |
+ InvokeCode(code_reg, new_target, expected, actual, flag, call_wrapper); |
} |
@@ -1157,7 +1166,7 @@ void MacroAssembler::InvokeFunction(Register function, |
// allow recompilation to take effect without changing any of the |
// call sites. |
LoadP(ip, FieldMemOperand(r4, JSFunction::kCodeEntryOffset)); |
- InvokeCode(ip, expected, actual, flag, call_wrapper); |
+ InvokeCode(ip, no_reg, expected, actual, flag, call_wrapper); |
} |