Index: src/mips/code-stubs-mips.cc |
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc |
index 309fcf8abee890cba19408228bfadf33956e4117..edb80ca0544cc471f32536dba1bc3708cd6037ae 100644 |
--- a/src/mips/code-stubs-mips.cc |
+++ b/src/mips/code-stubs-mips.cc |
@@ -4822,12 +4822,11 @@ void ArrayConstructorStub::GenerateDispatchToArrayStub( |
void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
// ----------- S t a t e ------------- |
- // -- a0 : argc (only if argument_count() == ANY) |
+ // -- a0 : argc (only if argument_count() is ANY or MORE_THAN_ONE) |
// -- a1 : constructor |
// -- a2 : AllocationSite or undefined |
// -- a3 : Original constructor |
- // -- sp[0] : return address |
- // -- sp[4] : last argument |
+ // -- sp[0] : last argument |
// ----------------------------------- |
if (FLAG_debug_code) { |
@@ -4865,8 +4864,28 @@ void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
__ bind(&no_info); |
GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
+ // Subclassing. |
__ bind(&subclassing); |
- __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); |
+ __ Push(a1); |
+ __ Push(a3); |
+ |
+ // Adjust argc. |
+ switch (argument_count()) { |
+ case ANY: |
+ case MORE_THAN_ONE: |
+ __ li(at, Operand(2)); |
+ __ addu(a0, a0, at); |
+ break; |
+ case NONE: |
+ __ li(a0, Operand(2)); |
+ break; |
+ case ONE: |
+ __ li(a0, Operand(3)); |
+ break; |
+ } |
+ |
+ __ JumpToExternalReference( |
+ ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate())); |
} |