| Index: src/arm/code-stubs-arm.cc
|
| diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc
|
| index a3360ea2165ee332757b9a8d926c7c416cc3198f..c1ead67482fd12a3ff1fb3bcfc7732cc77c68125 100644
|
| --- a/src/arm/code-stubs-arm.cc
|
| +++ b/src/arm/code-stubs-arm.cc
|
| @@ -2384,28 +2384,33 @@ void RegExpExecStub::Generate(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| -static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub) {
|
| +static void CallStubInRecordCallTarget(MacroAssembler* masm, CodeStub* stub,
|
| + bool is_super) {
|
| // r0 : number of arguments to the construct function
|
| // r1 : the function to call
|
| // r2 : feedback vector
|
| // r3 : slot in feedback vector (Smi)
|
| - // r4 : original constructor
|
| + // r4 : original constructor (for IsSuperConstructorCall)
|
| FrameAndConstantPoolScope scope(masm, StackFrame::INTERNAL);
|
|
|
| // Number-of-arguments register must be smi-tagged to call out.
|
| __ SmiTag(r0);
|
| __ Push(r3, r2, r1, r0);
|
| - __ Push(r4);
|
| + if (is_super) {
|
| + __ Push(r4);
|
| + }
|
|
|
| __ CallStub(stub);
|
|
|
| - __ Pop(r4);
|
| + if (is_super) {
|
| + __ Pop(r4);
|
| + }
|
| __ Pop(r3, r2, r1, r0);
|
| __ SmiUntag(r0);
|
| }
|
|
|
|
|
| -static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| +static void GenerateRecordCallTarget(MacroAssembler* masm, bool is_super) {
|
| // Cache the called function in a feedback vector slot. Cache states
|
| // are uninitialized, monomorphic (indicated by a JSFunction), and
|
| // megamorphic.
|
| @@ -2413,7 +2418,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| // r1 : the function to call
|
| // r2 : feedback vector
|
| // r3 : slot in feedback vector (Smi)
|
| - // r4 : original constructor
|
| + // r4 : original constructor (for IsSuperConstructorCall)
|
| Label initialize, done, miss, megamorphic, not_array_function;
|
|
|
| DCHECK_EQ(*TypeFeedbackVector::MegamorphicSentinel(masm->isolate()),
|
| @@ -2488,14 +2493,14 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) {
|
| // Create an AllocationSite if we don't already have it, store it in the
|
| // slot.
|
| CreateAllocationSiteStub create_stub(masm->isolate());
|
| - CallStubInRecordCallTarget(masm, &create_stub);
|
| + CallStubInRecordCallTarget(masm, &create_stub, is_super);
|
| __ b(&done);
|
|
|
| __ bind(¬_array_function);
|
| }
|
|
|
| CreateWeakCellStub create_stub(masm->isolate());
|
| - CallStubInRecordCallTarget(masm, &create_stub);
|
| + CallStubInRecordCallTarget(masm, &create_stub, is_super);
|
| __ bind(&done);
|
| }
|
|
|
| @@ -2628,7 +2633,7 @@ void CallConstructStub::Generate(MacroAssembler* masm) {
|
| __ b(ne, &slow);
|
|
|
| if (RecordCallTarget()) {
|
| - GenerateRecordCallTarget(masm);
|
| + GenerateRecordCallTarget(masm, IsSuperConstructorCall());
|
|
|
| __ add(r5, r2, Operand::PointerOffsetFromSmiKey(r3));
|
| if (FLAG_pretenuring_call_new) {
|
|
|