| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index 6f18c19984ce1dce17834bd936fa5c036fdec96d..31e8b438ec4b4c4e4612047a8e013b5c82bee2e9 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -1689,6 +1689,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| __ IncrementCounter(isolate()->counters()->cow_arrays_created_stub(), 1);
|
| FastCloneShallowArrayStub stub(
|
| FastCloneShallowArrayStub::COPY_ON_WRITE_ELEMENTS,
|
| + DONT_TRACK_ALLOCATION_SITE_INFO,
|
| length);
|
| __ CallStub(&stub);
|
| } else if (expr->depth() > 1) {
|
| @@ -1698,21 +1699,19 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| } else {
|
| ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
|
| FLAG_smi_only_arrays);
|
| + FastCloneShallowArrayStub::Mode mode =
|
| + FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS;
|
| + AllocationSiteInfoMode allocation_site_info_mode =
|
| + AllocationSiteInfo::GetMode();
|
| +
|
| // If the elements are already FAST_*_ELEMENTS, the boilerplate cannot
|
| // change, so it's possible to specialize the stub in advance.
|
| - FastCloneShallowArrayStub::Mode mode = has_constant_fast_elements
|
| - ? FastCloneShallowArrayStub::CLONE_ELEMENTS
|
| - : FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS;
|
| -
|
| - // Tracking allocation info allows us to pre-transition later if it makes
|
| - // sense.
|
| - if (mode == FastCloneShallowArrayStub::CLONE_ANY_ELEMENTS &&
|
| - FLAG_track_allocation_sites) {
|
| - mode = FastCloneShallowArrayStub::
|
| - CLONE_ANY_ELEMENTS_WITH_ALLOCATION_SITE_INFO;
|
| + if (has_constant_fast_elements) {
|
| + mode = FastCloneShallowArrayStub::CLONE_ELEMENTS;
|
| + allocation_site_info_mode = DONT_TRACK_ALLOCATION_SITE_INFO;
|
| }
|
|
|
| - FastCloneShallowArrayStub stub(mode, length);
|
| + FastCloneShallowArrayStub stub(mode, allocation_site_info_mode, length);
|
| __ CallStub(&stub);
|
| }
|
|
|
|
|