OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PPC | 5 #if V8_TARGET_ARCH_PPC |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
(...skipping 1697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1708 context()->PlugTOS(); | 1708 context()->PlugTOS(); |
1709 } else { | 1709 } else { |
1710 context()->Plug(r3); | 1710 context()->Plug(r3); |
1711 } | 1711 } |
1712 } | 1712 } |
1713 | 1713 |
1714 | 1714 |
1715 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { | 1715 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
1716 Comment cmnt(masm_, "[ ArrayLiteral"); | 1716 Comment cmnt(masm_, "[ ArrayLiteral"); |
1717 | 1717 |
1718 expr->BuildConstantElements(isolate()); | |
1719 Handle<FixedArray> constant_elements = expr->constant_elements(); | 1718 Handle<FixedArray> constant_elements = expr->constant_elements(); |
1720 bool has_fast_elements = | 1719 bool has_fast_elements = |
1721 IsFastObjectElementsKind(expr->constant_elements_kind()); | 1720 IsFastObjectElementsKind(expr->constant_elements_kind()); |
1722 Handle<FixedArrayBase> constant_elements_values( | 1721 Handle<FixedArrayBase> constant_elements_values( |
1723 FixedArrayBase::cast(constant_elements->get(1))); | 1722 FixedArrayBase::cast(constant_elements->get(1))); |
1724 | 1723 |
1725 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; | 1724 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; |
1726 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { | 1725 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { |
1727 // If the only customer of allocation sites is transitioning, then | 1726 // If the only customer of allocation sites is transitioning, then |
1728 // we can turn it off if we don't have anywhere else to transition to. | 1727 // we can turn it off if we don't have anywhere else to transition to. |
(...skipping 28 matching lines...) Expand all Loading... |
1757 // is already set in the cloned array. | 1756 // is already set in the cloned array. |
1758 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; | 1757 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; |
1759 | 1758 |
1760 if (!result_saved) { | 1759 if (!result_saved) { |
1761 __ push(r3); | 1760 __ push(r3); |
1762 __ Push(Smi::FromInt(expr->literal_index())); | 1761 __ Push(Smi::FromInt(expr->literal_index())); |
1763 result_saved = true; | 1762 result_saved = true; |
1764 } | 1763 } |
1765 VisitForAccumulatorValue(subexpr); | 1764 VisitForAccumulatorValue(subexpr); |
1766 | 1765 |
1767 if (has_fast_elements) { | 1766 if (FLAG_vector_stores) { |
| 1767 __ LoadSmiLiteral(StoreDescriptor::NameRegister(), |
| 1768 Smi::FromInt(array_index)); |
| 1769 __ LoadP(StoreDescriptor::ReceiverRegister(), |
| 1770 MemOperand(sp, kPointerSize)); |
| 1771 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot()); |
| 1772 Handle<Code> ic = |
| 1773 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code(); |
| 1774 CallIC(ic); |
| 1775 } else if (has_fast_elements) { |
1768 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); | 1776 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); |
1769 __ LoadP(r8, MemOperand(sp, kPointerSize)); // Copy of array literal. | 1777 __ LoadP(r8, MemOperand(sp, kPointerSize)); // Copy of array literal. |
1770 __ LoadP(r4, FieldMemOperand(r8, JSObject::kElementsOffset)); | 1778 __ LoadP(r4, FieldMemOperand(r8, JSObject::kElementsOffset)); |
1771 __ StoreP(result_register(), FieldMemOperand(r4, offset), r0); | 1779 __ StoreP(result_register(), FieldMemOperand(r4, offset), r0); |
1772 // Update the write barrier for the array store. | 1780 // Update the write barrier for the array store. |
1773 __ RecordWriteField(r4, offset, result_register(), r5, kLRHasBeenSaved, | 1781 __ RecordWriteField(r4, offset, result_register(), r5, kLRHasBeenSaved, |
1774 kDontSaveFPRegs, EMIT_REMEMBERED_SET, | 1782 kDontSaveFPRegs, EMIT_REMEMBERED_SET, |
1775 INLINE_SMI_CHECK); | 1783 INLINE_SMI_CHECK); |
1776 } else { | 1784 } else { |
1777 __ LoadSmiLiteral(r6, Smi::FromInt(array_index)); | 1785 __ LoadSmiLiteral(r6, Smi::FromInt(array_index)); |
(...skipping 3448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5226 return ON_STACK_REPLACEMENT; | 5234 return ON_STACK_REPLACEMENT; |
5227 } | 5235 } |
5228 | 5236 |
5229 DCHECK(interrupt_address == | 5237 DCHECK(interrupt_address == |
5230 isolate->builtins()->OsrAfterStackCheck()->entry()); | 5238 isolate->builtins()->OsrAfterStackCheck()->entry()); |
5231 return OSR_AFTER_STACK_CHECK; | 5239 return OSR_AFTER_STACK_CHECK; |
5232 } | 5240 } |
5233 } // namespace internal | 5241 } // namespace internal |
5234 } // namespace v8 | 5242 } // namespace v8 |
5235 #endif // V8_TARGET_ARCH_PPC | 5243 #endif // V8_TARGET_ARCH_PPC |
OLD | NEW |