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

Side by Side Diff: src/full-codegen/arm64/full-codegen-arm64.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/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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_ARM64 5 #if V8_TARGET_ARCH_ARM64
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 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 context()->PlugTOS(); 1730 context()->PlugTOS();
1731 } else { 1731 } else {
1732 context()->Plug(x0); 1732 context()->Plug(x0);
1733 } 1733 }
1734 } 1734 }
1735 1735
1736 1736
1737 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { 1737 void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
1738 Comment cmnt(masm_, "[ ArrayLiteral"); 1738 Comment cmnt(masm_, "[ ArrayLiteral");
1739 1739
1740 expr->BuildConstantElements(isolate());
1741 Handle<FixedArray> constant_elements = expr->constant_elements(); 1740 Handle<FixedArray> constant_elements = expr->constant_elements();
1742 bool has_fast_elements = 1741 bool has_fast_elements =
1743 IsFastObjectElementsKind(expr->constant_elements_kind()); 1742 IsFastObjectElementsKind(expr->constant_elements_kind());
1744 1743
1745 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE; 1744 AllocationSiteMode allocation_site_mode = TRACK_ALLOCATION_SITE;
1746 if (has_fast_elements && !FLAG_allocation_site_pretenuring) { 1745 if (has_fast_elements && !FLAG_allocation_site_pretenuring) {
1747 // If the only customer of allocation sites is transitioning, then 1746 // If the only customer of allocation sites is transitioning, then
1748 // we can turn it off if we don't have anywhere else to transition to. 1747 // we can turn it off if we don't have anywhere else to transition to.
1749 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; 1748 allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
1750 } 1749 }
(...skipping 27 matching lines...) Expand all
1778 // is already set in the cloned array. 1777 // is already set in the cloned array.
1779 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue; 1778 if (CompileTimeValue::IsCompileTimeValue(subexpr)) continue;
1780 1779
1781 if (!result_saved) { 1780 if (!result_saved) {
1782 __ Mov(x1, Smi::FromInt(expr->literal_index())); 1781 __ Mov(x1, Smi::FromInt(expr->literal_index()));
1783 __ Push(x0, x1); 1782 __ Push(x0, x1);
1784 result_saved = true; 1783 result_saved = true;
1785 } 1784 }
1786 VisitForAccumulatorValue(subexpr); 1785 VisitForAccumulatorValue(subexpr);
1787 1786
1788 if (has_fast_elements) { 1787 if (FLAG_vector_stores) {
1788 __ Mov(StoreDescriptor::NameRegister(), Smi::FromInt(array_index));
1789 __ Peek(StoreDescriptor::ReceiverRegister(), kPointerSize);
1790 EmitLoadStoreICSlot(expr->LiteralFeedbackSlot());
1791 Handle<Code> ic =
1792 CodeFactory::KeyedStoreIC(isolate(), language_mode()).code();
1793 CallIC(ic);
1794 } else if (has_fast_elements) {
1789 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize); 1795 int offset = FixedArray::kHeaderSize + (array_index * kPointerSize);
1790 __ Peek(x6, kPointerSize); // Copy of array literal. 1796 __ Peek(x6, kPointerSize); // Copy of array literal.
1791 __ Ldr(x1, FieldMemOperand(x6, JSObject::kElementsOffset)); 1797 __ Ldr(x1, FieldMemOperand(x6, JSObject::kElementsOffset));
1792 __ Str(result_register(), FieldMemOperand(x1, offset)); 1798 __ Str(result_register(), FieldMemOperand(x1, offset));
1793 // Update the write barrier for the array store. 1799 // Update the write barrier for the array store.
1794 __ RecordWriteField(x1, offset, result_register(), x10, 1800 __ RecordWriteField(x1, offset, result_register(), x10,
1795 kLRHasBeenSaved, kDontSaveFPRegs, 1801 kLRHasBeenSaved, kDontSaveFPRegs,
1796 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK); 1802 EMIT_REMEMBERED_SET, INLINE_SMI_CHECK);
1797 } else { 1803 } else {
1798 __ Mov(x3, Smi::FromInt(array_index)); 1804 __ Mov(x3, Smi::FromInt(array_index));
(...skipping 3468 matching lines...) Expand 10 before | Expand all | Expand 10 after
5267 } 5273 }
5268 5274
5269 return INTERRUPT; 5275 return INTERRUPT;
5270 } 5276 }
5271 5277
5272 5278
5273 } // namespace internal 5279 } // namespace internal
5274 } // namespace v8 5280 } // namespace v8
5275 5281
5276 #endif // V8_TARGET_ARCH_ARM64 5282 #endif // V8_TARGET_ARCH_ARM64
OLDNEW
« no previous file with comments | « src/full-codegen/arm/full-codegen-arm.cc ('k') | src/full-codegen/ia32/full-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698