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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
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 1730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1741 context()->PlugTOS(); | 1741 context()->PlugTOS(); |
1742 } else { | 1742 } else { |
1743 context()->Plug(v0); | 1743 context()->Plug(v0); |
1744 } | 1744 } |
1745 } | 1745 } |
1746 | 1746 |
1747 | 1747 |
1748 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1748 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1749 Comment cmnt(masm_, "[ ArrayLiteral"); | 1749 Comment cmnt(masm_, "[ ArrayLiteral"); |
1750 | 1750 |
1751 expr->BuildConstantElements(isolate()); | |
1752 | |
1753 Handle<FixedArray> constant_elements = expr->constant_elements(); | 1751 Handle<FixedArray> constant_elements = expr->constant_elements(); |
1754 bool has_fast_elements = | 1752 bool has_fast_elements = |
1755 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1753 IsFastObjectElementsKind(expr->constant_elements_kind()); |
1756 | 1754 |
1757 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1755 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1758 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1756 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
1759 // If the only customer of allocation sites is transitioning, then | 1757 // If the only customer of allocation sites is transitioning, then |
1760 // we can turn it off if we don't have anywhere else to transition to. | 1758 // we can turn it off if we don't have anywhere else to transition to. |
1761 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; | 1759 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
1762 } | 1760 } |
(...skipping 29 matching lines...) Expand all Loading... |
1792 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1790 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
1793 | 1791 |
1794 if (!result_saved) { | 1792 if (!result_saved) { |
1795 __ push(v0); // array literal | 1793 __ push(v0); // array literal |
1796 __ Push(Smi::FromInt(expr->literal_index())); | 1794 __ Push(Smi::FromInt(expr->literal_index())); |
1797 result_saved = true; | 1795 result_saved = true; |
1798 } | 1796 } |
1799 | 1797 |
1800 VisitForAccumulatorValue(subexpr); | 1798 VisitForAccumulatorValue(subexpr); |
1801 | 1799 |
1802 if (has_fast_elements) { | 1800 if (FLAG_vector_stores) { |
| 1801 __ li(StoreDescriptor::NameRegister(), |
| 1802 Operand(Smi::FromInt(array_index))); |
| 1803 __ ld(StoreDescriptor::ReceiverRegister(), MemOperand(sp, kPointerSize)); |
| 1804 __ mov(StoreDescriptor::ValueRegister(), result_register()); |
| 1805 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1806 Handle<Code> ic = |
| 1807 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 1808 CallIC(ic); |
| 1809 } else if (has_fast_elements) { |
1803 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); | 1810 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); |
1804 __ ld(a6, MemOperand(sp, kPointerSize)); // Copy of array literal. | 1811 __ ld(a6, MemOperand(sp, kPointerSize)); // Copy of array literal. |
1805 __ ld(a1, FieldMemOperand(a6, JSObject::kElementsOffset)); | 1812 __ ld(a1, FieldMemOperand(a6, JSObject::kElementsOffset)); |
1806 __ sd(result_register(), FieldMemOperand(a1, offset)); | 1813 __ sd(result_register(), FieldMemOperand(a1, offset)); |
1807 // Update the write barrier for the array store. | 1814 // Update the write barrier for the array store. |
1808 __ RecordWriteField(a1, offset, result_register(), a2, | 1815 __ RecordWriteField(a1, offset, result_register(), a2, |
1809 kRAHasBeenSaved, kDontSaveFPRegs, | 1816 kRAHasBeenSaved, kDontSaveFPRegs, |
1810 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); | 1817 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); |
1811 } else { | 1818 } else { |
1812 __ li(a3, Operand(Smi::FromInt(array_index))); | 1819 __ li(a3, Operand(Smi::FromInt(array_index))); |
(...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5256 reinterpret_cast<uint64_t>( | 5263 reinterpret_cast<uint64_t>( |
5257 isolate->builtins()->OsrAfterStackCheck()->entry())); | 5264 isolate->builtins()->OsrAfterStackCheck()->entry())); |
5258 return OSR_AFTER_STACK_CHECK; | 5265 return OSR_AFTER_STACK_CHECK; |
5259 } | 5266 } |
5260 | 5267 |
5261 | 5268 |
5262 } // namespace internal | 5269 } // namespace internal |
5263 } // namespace v8 | 5270 } // namespace v8 |
5264 | 5271 |
5265 #endif // V8_TARGET_ARCH_MIPS64 | 5272 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |