Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index 8b16e6c157254c0747db0f1a5e36af39522bcff3..a860435698bc7fe3a6d3003554160d8f41f252a3 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -1796,6 +1796,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; |
+ } |
+ |
__ mov(a0, result_register()); |
__ lw(a3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
__ lw(a3, FieldMemOperand(a3, JSFunction::kLiteralsOffset)); |
@@ -1805,7 +1813,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(isolate()->counters()->cow_arrays_created_stub(), |
@@ -1820,12 +1828,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); |