Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index da6bdb75c58fa180dcf5acb069d436ed57ae307e..1703d4bcbf80127d17a094e669316bbfdb1139bb 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -2749,17 +2749,25 @@ void RegExpExecStub::Generate(MacroAssembler* masm) { |
static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub, |
Register argc, Register function, |
Register feedback_vector, Register index, |
- Register orig_construct) { |
+ Register orig_construct, bool is_super) { |
FrameScope scope(masm, StackFrame::INTERNAL); |
// Number-of-arguments register must be smi-tagged to call out. |
__ SmiTag(argc); |
- __ Push(argc, function, feedback_vector, index, orig_construct); |
+ if (is_super) { |
+ __ Push(argc, function, feedback_vector, index, orig_construct); |
jbramley
2015/07/22 07:51:36
Why not pass orig_construct=NoReg for the !is_supe
Michael Starzinger
2015/07/22 08:07:41
The way the 8-register push is implemented, it ass
|
+ } else { |
+ __ Push(argc, function, feedback_vector, index); |
+ } |
DCHECK(feedback_vector.Is(x2) && index.Is(x3)); |
__ CallStub(stub); |
- __ Pop(orig_construct, index, feedback_vector, function, argc); |
+ if (is_super) { |
+ __ Pop(orig_construct, index, feedback_vector, function, argc); |
+ } else { |
+ __ Pop(index, feedback_vector, function, argc); |
+ } |
__ SmiUntag(argc); |
} |
@@ -2768,7 +2776,8 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc, |
Register function, |
Register feedback_vector, Register index, |
Register orig_construct, Register scratch1, |
- Register scratch2, Register scratch3) { |
+ Register scratch2, Register scratch3, |
+ bool is_super) { |
ASM_LOCATION("GenerateRecordCallTarget"); |
DCHECK(!AreAliased(scratch1, scratch2, scratch3, argc, function, |
feedback_vector, index, orig_construct)); |
@@ -2778,7 +2787,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc, |
// function : the function to call |
// feedback_vector : the feedback vector |
// index : slot in feedback vector (smi) |
- // orig_construct : original constructor |
+ // orig_construct : original constructor (for IsSuperConstructorCall) |
Label initialize, done, miss, megamorphic, not_array_function; |
DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()), |
@@ -2857,7 +2866,8 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc, |
// slot. |
CreateAllocationSiteStub create_stub(masm->isolate()); |
CallStubInRecordCallTarget(masm, &create_stub, argc, function, |
- feedback_vector, index, orig_construct); |
+ feedback_vector, index, orig_construct, |
+ is_super); |
__ B(&done); |
__ Bind(¬_array_function); |
@@ -2865,7 +2875,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm, Register argc, |
CreateWeakCellStub create_stub(masm->isolate()); |
CallStubInRecordCallTarget(masm, &create_stub, argc, function, |
- feedback_vector, index, orig_construct); |
+ feedback_vector, index, orig_construct, is_super); |
__ Bind(&done); |
} |
@@ -3005,7 +3015,8 @@ void CallConstructStub::Generate(MacroAssembler* masm) { |
&slow); |
if (RecordCallTarget()) { |
- GenerateRecordCallTarget(masm, x0, function, x2, x3, x4, x5, x11, x12); |
+ GenerateRecordCallTarget(masm, x0, function, x2, x3, x4, x5, x11, x12, |
+ IsSuperConstructorCall()); |
__ Add(x5, x2, Operand::UntagSmiAndScale(x3, kPointerSizeLog2)); |
if (FLAG_pretenuring_call_new) { |