| 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_MIPS64 | 7 #if V8_TARGET_ARCH_MIPS64 |
| 8 | 8 |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 4826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4837 } | 4837 } |
| 4838 } | 4838 } |
| 4839 | 4839 |
| 4840 | 4840 |
| 4841 void ArrayConstructorStub::Generate(MacroAssembler* masm) { | 4841 void ArrayConstructorStub::Generate(MacroAssembler* masm) { |
| 4842 // ----------- S t a t e ------------- | 4842 // ----------- S t a t e ------------- |
| 4843 // -- a0 : argc (only if argument_count() == ANY) | 4843 // -- a0 : argc (only if argument_count() == ANY) |
| 4844 // -- a1 : constructor | 4844 // -- a1 : constructor |
| 4845 // -- a2 : AllocationSite or undefined | 4845 // -- a2 : AllocationSite or undefined |
| 4846 // -- a3 : original constructor | 4846 // -- a3 : original constructor |
| 4847 // -- sp[0] : return address | 4847 // -- sp[0] : last argument |
| 4848 // -- sp[4] : last argument | |
| 4849 // ----------------------------------- | 4848 // ----------------------------------- |
| 4850 | 4849 |
| 4851 if (FLAG_debug_code) { | 4850 if (FLAG_debug_code) { |
| 4852 // The array construct code is only set for the global and natives | 4851 // The array construct code is only set for the global and natives |
| 4853 // builtin Array functions which always have maps. | 4852 // builtin Array functions which always have maps. |
| 4854 | 4853 |
| 4855 // Initial map for the builtin Array function should be a map. | 4854 // Initial map for the builtin Array function should be a map. |
| 4856 __ ld(a4, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); | 4855 __ ld(a4, FieldMemOperand(a1, JSFunction::kPrototypeOrInitialMapOffset)); |
| 4857 // Will both indicate a NULL and a Smi. | 4856 // Will both indicate a NULL and a Smi. |
| 4858 __ SmiTst(a4, at); | 4857 __ SmiTst(a4, at); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4876 | 4875 |
| 4877 __ ld(a3, FieldMemOperand(a2, AllocationSite::kTransitionInfoOffset)); | 4876 __ ld(a3, FieldMemOperand(a2, AllocationSite::kTransitionInfoOffset)); |
| 4878 __ SmiUntag(a3); | 4877 __ SmiUntag(a3); |
| 4879 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); | 4878 STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0); |
| 4880 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); | 4879 __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask)); |
| 4881 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); | 4880 GenerateDispatchToArrayStub(masm, DONT_OVERRIDE); |
| 4882 | 4881 |
| 4883 __ bind(&no_info); | 4882 __ bind(&no_info); |
| 4884 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); | 4883 GenerateDispatchToArrayStub(masm, DISABLE_ALLOCATION_SITES); |
| 4885 | 4884 |
| 4885 // Subclassing. |
| 4886 __ bind(&subclassing); | 4886 __ bind(&subclassing); |
| 4887 __ TailCallRuntime(Runtime::kThrowArrayNotSubclassableError, 0, 1); | 4887 __ Push(a1); |
| 4888 __ Push(a3); |
| 4889 |
| 4890 // Adjust argc. |
| 4891 switch (argument_count()) { |
| 4892 case ANY: |
| 4893 case MORE_THAN_ONE: |
| 4894 __ li(at, Operand(2)); |
| 4895 __ addu(a0, a0, at); |
| 4896 break; |
| 4897 case NONE: |
| 4898 __ li(a0, Operand(2)); |
| 4899 break; |
| 4900 case ONE: |
| 4901 __ li(a0, Operand(3)); |
| 4902 break; |
| 4903 } |
| 4904 |
| 4905 __ JumpToExternalReference( |
| 4906 ExternalReference(Runtime::kArrayConstructorWithSubclassing, isolate())); |
| 4888 } | 4907 } |
| 4889 | 4908 |
| 4890 | 4909 |
| 4891 void InternalArrayConstructorStub::GenerateCase( | 4910 void InternalArrayConstructorStub::GenerateCase( |
| 4892 MacroAssembler* masm, ElementsKind kind) { | 4911 MacroAssembler* masm, ElementsKind kind) { |
| 4893 | 4912 |
| 4894 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); | 4913 InternalArrayNoArgumentConstructorStub stub0(isolate(), kind); |
| 4895 __ TailCallStub(&stub0, lo, a0, Operand(1)); | 4914 __ TailCallStub(&stub0, lo, a0, Operand(1)); |
| 4896 | 4915 |
| 4897 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); | 4916 InternalArrayNArgumentsConstructorStub stubN(isolate(), kind); |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5265 kStackUnwindSpace, kInvalidStackOffset, | 5284 kStackUnwindSpace, kInvalidStackOffset, |
| 5266 MemOperand(fp, 6 * kPointerSize), NULL); | 5285 MemOperand(fp, 6 * kPointerSize), NULL); |
| 5267 } | 5286 } |
| 5268 | 5287 |
| 5269 | 5288 |
| 5270 #undef __ | 5289 #undef __ |
| 5271 | 5290 |
| 5272 } } // namespace v8::internal | 5291 } } // namespace v8::internal |
| 5273 | 5292 |
| 5274 #endif // V8_TARGET_ARCH_MIPS64 | 5293 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |