| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
| 8 | 8 |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 4804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4815 } else if (argument_count() == MORE_THAN_ONE) { | 4815 } else if (argument_count() == MORE_THAN_ONE) { |
| 4816 CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); | 4816 CreateArrayDispatch<ArrayNArgumentsConstructorStub>(masm, mode); |
| 4817 } else { | 4817 } else { |
| 4818 UNREACHABLE(); | 4818 UNREACHABLE(); |
| 4819 } | 4819 } |
| 4820 } | 4820 } |
| 4821 | 4821 |
| 4822 | 4822 |
| 4823 void ArrayConstructorStub::Generate(MacroAssembler* masm) { | 4823 void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
| 4824 // ----------- S t a t e ------------- | 4824 // ----------- S t a t e ------------- |
| 4825 // -- a0 : argc (only if argument_count() == ANY) | 4825 // -- a0 : argc (only if argument_count() is ANY or MORE_THAN_ONE) |
| 4826 // -- a1 : constructor | 4826 // -- a1 : constructor |
| 4827 // -- a2 : AllocationSite or undefined | 4827 // -- a2 : AllocationSite or undefined |
| 4828 // -- a3 : Original constructor | 4828 // -- a3 : Original constructor |
| 4829 // -- sp[0] : return address | 4829 // -- sp[0] : last argument |
| 4830 // -- sp[4] : last argument | |
| 4831 // ----------------------------------- | 4830 // ----------------------------------- |
| 4832 | 4831 |
| 4833 if (FLAG_debug_code) { | 4832 if (FLAG_debug_code) { |
| 4834 // The array construct code is only set for the global and natives | 4833 // The array construct code is only set for the global and natives |
| 4835 // builtin Array functions which always have maps. | 4834 // builtin Array functions which always have maps. |
| 4836 | 4835 |
| 4837 // Initial map for the builtin Array function should be a map. | 4836 // Initial map for the builtin Array function should be a map. |
| 4838 __ lw(t0, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); | 4837 __ lw(t0, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 4839 // Will both indicate a NULL and a Smi. | 4838 // Will both indicate a NULL and a Smi. |
| 4840 __ SmiTst(t0, at); | 4839 __ SmiTst(t0, at); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4858 | 4857 |
| 4859 __ lw(a3, FieldMemOperand(a2, AllocationSite::kTransitionInfoOffset)); | 4858 __ lw(a3, FieldMemOperand(a2, AllocationSite::kTransitionInfoOffset)); |
| 4860 __ SmiUntag(a3); | 4859 __ SmiUntag(a3); |
| 4861 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 4860 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 4862 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); | 4861 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); |
| 4863 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 4862 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| 4864 | 4863 |
| 4865 __ bind(&no_info); | 4864 __ bind(&no_info); |
| 4866 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 4865 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
| 4867 | 4866 |
| 4867 // Subclassing. |
| 4868 __ bind(&subclassing); | 4868 __ bind(&subclassing); |
| 4869 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); | 4869 __ Push(a1); |
| 4870 __ Push(a3); |
| 4871 |
| 4872 // Adjust argc. |
| 4873 switch (argument_count()) { |
| 4874 case ANY: |
| 4875 case MORE_THAN_ONE: |
| 4876 __ li(at, Operand(2)); |
| 4877 __ addu(a0, a0, at); |
| 4878 break; |
| 4879 case NONE: |
| 4880 __ li(a0, Operand(2)); |
| 4881 break; |
| 4882 case ONE: |
| 4883 __ li(a0, Operand(3)); |
| 4884 break; |
| 4885 } |
| 4886 |
| 4887 __ JumpToExternalReference( |
| 4888 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate())); |
| 4870 } | 4889 } |
| 4871 | 4890 |
| 4872 | 4891 |
| 4873 void InternalArrayConstructorStub::GenerateCase( | 4892 void InternalArrayConstructorStub::GenerateCase( |
| 4874 MacroAssembler* masm, ElementsKind kind) { | 4893 MacroAssembler* masm, ElementsKind kind) { |
| 4875 | 4894 |
| 4876 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); | 4895 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); |
| 4877 __ TailCallStub(&stub0, lo, a0, Operand(1)); | 4896 __ TailCallStub(&stub0, lo, a0, Operand(1)); |
| 4878 | 4897 |
| 4879 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); | 4898 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5247 kStackUnwindSpace, kInvalidStackOffset, | 5266 kStackUnwindSpace, kInvalidStackOffset, |
| 5248 MemOperand(fp, 6 * kPointerSize), NULL); | 5267 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5249 } | 5268 } |
| 5250 | 5269 |
| 5251 | 5270 |
| 5252 #undef __ | 5271 #undef __ |
| 5253 | 5272 |
| 5254 } } // namespace v8::internal | 5273 } } // namespace v8::internal |
| 5255 | 5274 |
| 5256 #endif // V8_TARGET_ARCH_MIPS | 5275 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |