Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: src/full-codegen/arm/full-codegen-arm.cc

Issue 1405503002: VectorICs: use a vector slot to aid in array literal processing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Code comments. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_ARM 5 #if V8_TARGET_ARCH_ARM
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 1735 matching lines...) Expand 10 before | Expand all | Expand 10 after
1746 context()->PlugTOS(); 1746 context()->PlugTOS();
1747 } else { 1747 } else {
1748 context()->Plug(r0); 1748 context()->Plug(r0);
1749 } 1749 }
1750 } 1750 }
1751 1751
1752 1752
1753 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { 1753 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
1754 Comment cmnt(masm_, "[ ArrayLiteral"); 1754 Comment cmnt(masm_, "[ ArrayLiteral");
1755 1755
1756 expr->BuildConstantElements(isolate());
1757
1758 Handle<FixedArray> constant_elements = expr->constant_elements(); 1756 Handle<FixedArray> constant_elements = expr->constant_elements();
1759 bool has_fast_elements = 1757 bool has_fast_elements =
1760 IsFastObjectElementsKind(expr->constant_elements_kind()); 1758 IsFastObjectElementsKind(expr->constant_elements_kind());
1761 Handle<FixedArrayBase> constant_elements_values( 1759 Handle<FixedArrayBase> constant_elements_values(
1762 FixedArrayBase::cast(constant_elements->get(1))); 1760 FixedArrayBase::cast(constant_elements->get(1)));
1763 1761
1764 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; 1762 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
1765 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { 1763 if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
1766 // If the only customer of allocation sites is transitioning, then 1764 // If the only customer of allocation sites is transitioning, then
1767 // we can turn it off if we don't have anywhere else to transition to. 1765 // we can turn it off if we don't have anywhere else to transition to.
(...skipping 29 matching lines...) Expand all
1797 // is already set in the cloned array. 1795 // is already set in the cloned array.
1798 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1796 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1799 1797
1800 if (!result_saved) { 1798 if (!result_saved) {
1801 __ push(r0); 1799 __ push(r0);
1802 __ Push(Smi::FromInt(expr->literal_index())); 1800 __ Push(Smi::FromInt(expr->literal_index()));
1803 result_saved = true; 1801 result_saved = true;
1804 } 1802 }
1805 VisitForAccumulatorValue(subexpr); 1803 VisitForAccumulatorValue(subexpr);
1806 1804
1807 if (has_fast_elements) { 1805 if (FLAG_vector_stores) {
1806 __ mov(StoreDescriptor::NameRegister(),
1807 Operand(Smi::FromInt(array_index)));
1808 __ ldr(StoreDescriptor::ReceiverRegister(), MemOperand(sp, kPointerSize));
1809 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
1810 Handle<Code> ic =
1811 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
1812 CallIC(ic);
1813 } else if (has_fast_elements) {
1808 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); 1814 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize);
1809 __ ldr(r6, MemOperand(sp, kPointerSize)); // Copy of array literal. 1815 __ ldr(r6, MemOperand(sp, kPointerSize)); // Copy of array literal.
1810 __ ldr(r1, FieldMemOperand(r6, JSObject::kElementsOffset)); 1816 __ ldr(r1, FieldMemOperand(r6, JSObject::kElementsOffset));
1811 __ str(result_register(), FieldMemOperand(r1, offset)); 1817 __ str(result_register(), FieldMemOperand(r1, offset));
1812 // Update the write barrier for the array store. 1818 // Update the write barrier for the array store.
1813 __ RecordWriteField(r1, offset, result_register(), r2, 1819 __ RecordWriteField(r1, offset, result_register(), r2,
1814 kLRHasBeenSaved, kDontSaveFPRegs, 1820 kLRHasBeenSaved, kDontSaveFPRegs,
1815 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); 1821 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK);
1816 } else { 1822 } else {
1817 __ mov(r3, Operand(Smi::FromInt(array_index))); 1823 __ mov(r3, Operand(Smi::FromInt(array_index)));
(...skipping 3462 matching lines...) Expand 10 before | Expand all | Expand 10 after
5280 DCHECK(interrupt_address == 5286 DCHECK(interrupt_address ==
5281 isolate->builtins()->OsrAfterStackCheck()->entry()); 5287 isolate->builtins()->OsrAfterStackCheck()->entry());
5282 return OSR_AFTER_STACK_CHECK; 5288 return OSR_AFTER_STACK_CHECK;
5283 } 5289 }
5284 5290
5285 5291
5286 } // namespace internal 5292 } // namespace internal
5287 } // namespace v8 5293 } // namespace v8
5288 5294
5289 #endif // V8_TARGET_ARCH_ARM 5295 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « src/compiler/js-generic-lowering.cc ('k') | src/full-codegen/arm64/full-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698