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 "v8.h" | 5 #include "v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
8 | 8 |
9 // Note on Mips implementation: | 9 // Note on Mips implementation: |
10 // | 10 // |
(...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1803 __ mov(a0, result_register()); | 1803 __ mov(a0, result_register()); |
1804 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 1804 __ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
1805 __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); | 1805 __ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); |
1806 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); | 1806 __ li(a2, Operand(Smi::FromInt(expr->literal_index()))); |
1807 __ li(a1, Operand(constant_elements)); | 1807 __ li(a1, Operand(constant_elements)); |
1808 if (expr->depth() > 1) { | 1808 if (expr->depth() > 1) { |
1809 __ li(a0, Operand(Smi::FromInt(flags))); | 1809 __ li(a0, Operand(Smi::FromInt(flags))); |
1810 __ Push(a3, a2, a1, a0); | 1810 __ Push(a3, a2, a1, a0); |
1811 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); | 1811 __ CallRuntime(Runtime::kHiddenCreateArrayLiteral, 4); |
1812 } else { | 1812 } else { |
1813 ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || | 1813 FastCloneShallowArrayStub stub(isolate(), allocation_site_mode); |
1814 FLAG_smi_only_arrays); | |
1815 FastCloneShallowArrayStub::Mode mode = | |
1816 FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; | |
1817 | |
1818 if (has_fast_elements) { | |
1819 mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; | |
1820 } | |
1821 | |
1822 FastCloneShallowArrayStub stub(isolate(), mode, allocation_site_mode, | |
1823 length); | |
1824 __ CallStub(&stub); | 1814 __ CallStub(&stub); |
1825 } | 1815 } |
1826 | 1816 |
1827 bool result_saved = false; // Is the result saved to the stack? | 1817 bool result_saved = false; // Is the result saved to the stack? |
1828 | 1818 |
1829 // Emit code to evaluate all the non-constant subexpressions and to store | 1819 // Emit code to evaluate all the non-constant subexpressions and to store |
1830 // them into the newly cloned array. | 1820 // them into the newly cloned array. |
1831 for (int i = 0; i < length; i++) { | 1821 for (int i = 0; i < length; i++) { |
1832 Expression* subexpr = subexprs->at(i); | 1822 Expression* subexpr = subexprs->at(i); |
1833 // If the subexpression is a literal or a simple materialized literal it | 1823 // If the subexpression is a literal or a simple materialized literal it |
(...skipping 3028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4862 Assembler::target_address_at(pc_immediate_load_address)) == | 4852 Assembler::target_address_at(pc_immediate_load_address)) == |
4863 reinterpret_cast<uint32_t>( | 4853 reinterpret_cast<uint32_t>( |
4864 isolate->builtins()->OsrAfterStackCheck()->entry())); | 4854 isolate->builtins()->OsrAfterStackCheck()->entry())); |
4865 return OSR_AFTER_STACK_CHECK; | 4855 return OSR_AFTER_STACK_CHECK; |
4866 } | 4856 } |
4867 | 4857 |
4868 | 4858 |
4869 } } // namespace v8::internal | 4859 } } // namespace v8::internal |
4870 | 4860 |
4871 #endif // V8_TARGET_ARCH_MIPS | 4861 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |