Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 15bfba3ce61c4454586e6d776833eb975b93109c..17139c1704b50cc17ca23cc6b9850e168fdea648 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1784,6 +1784,14 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
Handle<FixedArrayBase> constant_elements_values( |
FixedArrayBase::cast(constant_elements->get(1))); |
+ AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites |
+ ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; |
+ if (has_constant_fast_elements && !FLAG_allocation_site_pretenuring) { |
+ // If the only customer of allocation sites is transitioning, then |
+ // we can turn it off if we don't have anywhere else to transition to. |
+ allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
+ } |
+ |
__ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
__ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
__ mov(r2, Operand(Smi::FromInt(expr->literal_index()))); |
@@ -1792,7 +1800,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
isolate()->heap()->fixed_cow_array_map()) { |
FastCloneShallowArrayStub stub( |
FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS, |
- DONT_TRACK_ALLOCATION_SITE, |
+ allocation_site_mode, |
length); |
__ CallStub(&stub); |
__ IncrementCounter( |
@@ -1807,12 +1815,9 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
FLAG_smi_only_arrays); |
FastCloneShallowArrayStub::Mode mode = |
FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS; |
- AllocationSiteMode allocation_site_mode = FLAG_track_allocation_sites |
- ? TRACK_ALLOCATION_SITE : DONT_TRACK_ALLOCATION_SITE; |
if (has_fast_elements) { |
mode = FastCloneShallowArrayStub::CLONE_ELEMENTS; |
- allocation_site_mode = DONT_TRACK_ALLOCATION_SITE; |
} |
FastCloneShallowArrayStub stub(mode, allocation_site_mode, length); |