| Index: src/arm/full-codegen-arm.cc
|
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
|
| index 1df1649d3dca1322f8b34edbd4f2705332d7ee1a..b2b92ac666ba3e41881a26d5815d466394b8bef9 100644
|
| --- a/src/arm/full-codegen-arm.cc
|
| +++ b/src/arm/full-codegen-arm.cc
|
| @@ -1590,6 +1590,12 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| flags |= expr->has_function()
|
| ? ObjectLiteral::kHasFunction
|
| : ObjectLiteral::kNoFlags;
|
| +
|
| + if (FLAG_track_allocation_sites && !IsOneTimeCode()) {
|
| + // Don't track global arrays that are never re-created
|
| + flags |= ObjectLiteral::kCreateAllocationSiteInfos;
|
| + }
|
| +
|
| __ mov(r0, Operand(Smi::FromInt(flags)));
|
| int properties_count = constant_properties->length() / 2;
|
| if (expr->depth() > 1) {
|
| @@ -1723,10 +1729,24 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| Handle<FixedArrayBase> constant_elements_values(
|
| FixedArrayBase::cast(constant_elements->get(1)));
|
|
|
| + AllocationSiteMode allocation_site_mode = DONT_TRACK_ALLOCATION_SITE;
|
| + int flags = ArrayLiteral::kNoFlags;
|
| + if (FLAG_track_allocation_sites && !IsOneTimeCode()) {
|
| + // Don't track global arrays that are never re-created
|
| + flags |= ArrayLiteral::kCreateAllocationSiteInfos;
|
| + allocation_site_mode = TRACK_ALLOCATION_SITE;
|
| + }
|
| +
|
| + ASSERT(((flags & ArrayLiteral::kCreateAllocationSiteInfos) &&
|
| + (allocation_site_mode == TRACK_ALLOCATION_SITE)) ||
|
| + (((flags & ArrayLiteral::kCreateAllocationSiteInfos) == 0) &&
|
| + (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())));
|
| __ mov(r1, Operand(constant_elements));
|
| +
|
| __ Push(r3, r2, r1);
|
| if (has_fast_elements && constant_elements_values->map() ==
|
| isolate()->heap()->fixed_cow_array_map()) {
|
| @@ -1738,16 +1758,18 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| __ IncrementCounter(
|
| isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2);
|
| } else if (expr->depth() > 1) {
|
| - __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
|
| + __ mov(r0, Operand(Smi::FromInt(flags)));
|
| + __ push(r0);
|
| + __ CallRuntime(Runtime::kCreateArrayLiteral, 4);
|
| } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
| - __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
|
| + __ mov(r0, Operand(Smi::FromInt(flags)));
|
| + __ push(r0);
|
| + __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 4);
|
| } else {
|
| ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) ||
|
| 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;
|
|
|