Index: src/ppc/code-stubs-ppc.cc |
diff --git a/src/ppc/code-stubs-ppc.cc b/src/ppc/code-stubs-ppc.cc |
index e7c11e7bc621cf2c9e363797f81505f56e405a3d..61e510d03c784514d1a18da036f02329ce2bf13c 100644 |
--- a/src/ppc/code-stubs-ppc.cc |
+++ b/src/ppc/code-stubs-ppc.cc |
@@ -2788,18 +2788,25 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
// r3 : number of arguments |
// r4 : the function to call |
// r5 : feedback vector |
- // r6 : (only if r5 is not the megamorphic symbol) slot in feedback |
- // vector (Smi) |
+ // r6 : slot in feedback vector (Smi, for RecordCallTarget) |
+ // r7 : original constructor (for IsSuperConstructorCall) |
Label slow, non_function_call; |
// Check that the function is not a smi. |
__ JumpIfSmi(r4, &non_function_call); |
// Check that the function is a JSFunction. |
- __ CompareObjectType(r4, r7, r7, JS_FUNCTION_TYPE); |
+ __ CompareObjectType(r4, r8, r8, JS_FUNCTION_TYPE); |
__ bne(&slow); |
if (RecordCallTarget()) { |
+ if (IsSuperConstructorCall()) { |
+ __ push(r7); |
+ } |
+ // TODO(mstarzinger): Consider tweaking target recording to avoid push/pop. |
GenerateRecordCallTarget(masm); |
+ if (IsSuperConstructorCall()) { |
+ __ pop(r7); |
+ } |
__ SmiToPtrArrayOffset(r8, r6); |
__ add(r8, r5, r8); |
@@ -2829,9 +2836,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
// Pass function as original constructor. |
if (IsSuperConstructorCall()) { |
- __ ShiftLeftImm(r7, r3, Operand(kPointerSizeLog2)); |
- __ addi(r7, r7, Operand(kPointerSize)); |
- __ LoadPX(r6, MemOperand(sp, r7)); |
+ __ mr(r6, r7); |
} else { |
__ mr(r6, r4); |
} |
@@ -2846,11 +2851,11 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
// r3: number of arguments |
// r4: called object |
- // r7: object type |
+ // r8: object type |
Label do_call; |
__ bind(&slow); |
STATIC_ASSERT(JS_FUNCTION_PROXY_TYPE < 0xffffu); |
- __ cmpi(r7, Operand(JS_FUNCTION_PROXY_TYPE)); |
+ __ cmpi(r8, Operand(JS_FUNCTION_PROXY_TYPE)); |
__ bne(&non_function_call); |
__ GetBuiltinFunction(r4, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); |
__ b(&do_call); |