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 #if V8_TARGET_ARCH_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
6 | 6 |
7 // Note on Mips implementation: | 7 // Note on Mips implementation: |
8 // | 8 // |
9 // The result_register() for mips is the 'v0' register, which is defined | 9 // The result_register() for mips is the 'v0' register, which is defined |
10 // by the ABI to contain function return values. However, the first | 10 // by the ABI to contain function return values. However, the first |
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 context()->PlugTOS(); | 1743 context()->PlugTOS(); |
1744 } else { | 1744 } else { |
1745 context()->Plug(v0); | 1745 context()->Plug(v0); |
1746 } | 1746 } |
1747 } | 1747 } |
1748 | 1748 |
1749 | 1749 |
1750 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1750 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1751 Comment cmnt(masm_, "[ ArrayLiteral"); | 1751 Comment cmnt(masm_, "[ ArrayLiteral"); |
1752 | 1752 |
1753 expr->BuildConstantElements(isolate()); | |
1754 | |
1755 Handle<FixedArray> constant_elements = expr->constant_elements(); | 1753 Handle<FixedArray> constant_elements = expr->constant_elements(); |
1756 bool has_fast_elements = | 1754 bool has_fast_elements = |
1757 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1755 IsFastObjectElementsKind(expr->constant_elements_kind()); |
1758 | 1756 |
1759 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1757 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1760 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1758 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
1761 // If the only customer of allocation sites is transitioning, then | 1759 // If the only customer of allocation sites is transitioning, then |
1762 // we can turn it off if we don't have anywhere else to transition to. | 1760 // we can turn it off if we don't have anywhere else to transition to. |
1763 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1761 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1764 } | 1762 } |
(...skipping 29 matching lines...) Expand all Loading... |
1794 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1792 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
1795 | 1793 |
1796 if (!result_saved) { | 1794 if (!result_saved) { |
1797 __ push(v0); // array literal | 1795 __ push(v0); // array literal |
1798 __ Push(Smi::FromInt(expr->literal_index())); | 1796 __ Push(Smi::FromInt(expr->literal_index())); |
1799 result_saved = true; | 1797 result_saved = true; |
1800 } | 1798 } |
1801 | 1799 |
1802 VisitForAccumulatorValue(subexpr); | 1800 VisitForAccumulatorValue(subexpr); |
1803 | 1801 |
1804 if (has_fast_elements) { | 1802 if (FLAG_vector_stores) { |
| 1803 __ li(StoreDescriptor::NameRegister(), |
| 1804 Operand(Smi::FromInt(array_index))); |
| 1805 __ lw(StoreDescriptor::ReceiverRegister(), MemOperand(sp, kPointerSize)); |
| 1806 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
| 1807 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1808 Handle<Code> ic = |
| 1809 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 1810 CallIC(ic); |
| 1811 } else if (has_fast_elements) { |
1805 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); | 1812 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); |
1806 __ lw(t2, MemOperand(sp, kPointerSize)); // Copy of array literal. | 1813 __ lw(t2, MemOperand(sp, kPointerSize)); // Copy of array literal. |
1807 __ lw(a1, FieldMemOperand(t2, JSObject::kElementsOffset)); | 1814 __ lw(a1, FieldMemOperand(t2, JSObject::kElementsOffset)); |
1808 __ sw(result_register(), FieldMemOperand(a1, offset)); | 1815 __ sw(result_register(), FieldMemOperand(a1, offset)); |
1809 // Update the write barrier for the array store. | 1816 // Update the write barrier for the array store. |
1810 __ RecordWriteField(a1, offset, result_register(), a2, | 1817 __ RecordWriteField(a1, offset, result_register(), a2, |
1811 kRAHasBeenSaved, kDontSaveFPRegs, | 1818 kRAHasBeenSaved, kDontSaveFPRegs, |
1812 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); | 1819 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); |
1813 } else { | 1820 } else { |
1814 __ li(a3, Operand(Smi::FromInt(array_index))); | 1821 __ li(a3, Operand(Smi::FromInt(array_index))); |
(...skipping 3435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5250 reinterpret_cast<uint32_t>( | 5257 reinterpret_cast<uint32_t>( |
5251 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5258 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5252 return OSR_AFTER_STACK_CHECK; | 5259 return OSR_AFTER_STACK_CHECK; |
5253 } | 5260 } |
5254 | 5261 |
5255 | 5262 |
5256 } // namespace internal | 5263 } // namespace internal |
5257 } // namespace v8 | 5264 } // namespace v8 |
5258 | 5265 |
5259 #endif // V8_TARGET_ARCH_MIPS | 5266 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |