| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index 86c525d7f63e034af66868d20a94b34338cf6d3a..ba26553e8c4405ae14ac3065ff14a5cb38205c27 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -1716,6 +1716,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;
|
| + }
|
| +
|
| Heap* heap = isolate()->heap();
|
| if (has_constant_fast_elements &&
|
| constant_elements_values->map() == heap->fixed_cow_array_map()) {
|
| @@ -1728,7 +1736,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| __ mov(ecx, Immediate(constant_elements));
|
| FastCloneShallowArrayStub stub(
|
| FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS,
|
| - DONT_TRACK_ALLOCATION_SITE,
|
| + allocation_site_mode,
|
| length);
|
| __ CallStub(&stub);
|
| } else if (expr->depth() > 1 || Serializer::enabled() ||
|
| @@ -1743,14 +1751,11 @@ 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 the elements are already FAST_*_ELEMENTS, the boilerplate cannot
|
| // change, so it's possible to specialize the stub in advance.
|
| if (has_constant_fast_elements) {
|
| mode = FastCloneShallowArrayStub::CLONE_ELEMENTS;
|
| - allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
|
| }
|
|
|
| __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
|
|