Chromium Code Reviews| Index: src/arm/full-codegen-arm.cc |
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
| index cb83860d6ab96b5e35d938b7ec1462b395825e34..aba7b9a5c9c9ba2594c6d8c892c8b0a02704bd06 100644 |
| --- a/src/arm/full-codegen-arm.cc |
| +++ b/src/arm/full-codegen-arm.cc |
| @@ -1589,6 +1589,13 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
| flags |= expr->has_function() |
| ? ObjectLiteral::kHasFunction |
| : ObjectLiteral::kNoFlags; |
| + |
| + if (FLAG_track_allocation_sites && |
| + (loop_depth() != 0 || !scope()->is_global_scope())) { |
|
danno
2013/02/08 13:44:38
Add this as a predicate somewhere?
mvstanton
2013/02/11 11:11:24
Done.
|
| + // Don't track global arrays that are never re-created |
| + flags |= ObjectLiteral::kAllocationSiteInfoAllowed; |
| + } |
| + |
| __ mov(r0, Operand(Smi::FromInt(flags))); |
| __ Push(r3, r2, r1, r0); |
| int properties_count = constant_properties->length() / 2; |
| @@ -1711,11 +1718,26 @@ 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 && |
| + (loop_depth() != 0 || !scope()->is_global_scope())) { |
|
danno
2013/02/08 13:44:38
Add this as a predicate somewhere?
mvstanton
2013/02/11 11:11:24
Done.
|
| + // Don't track global arrays that are never re-created |
| + flags |= ArrayLiteral::kAllocationSiteInfoAllowed; |
| + allocation_site_mode = 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); |
| + |
| + ASSERT(((flags & ArrayLiteral::kAllocationSiteInfoAllowed) && |
| + (allocation_site_mode == TRACK_ALLOCATION_SITE)) || |
| + (((flags & ArrayLiteral::kAllocationSiteInfoAllowed) == 0) && |
| + (allocation_site_mode == DONT_TRACK_ALLOCATION_SITE))); |
| + __ mov(r0, Operand(Smi::FromInt(flags))); |
| + __ Push(r3, r2, r1, r0); |
| if (has_fast_elements && constant_elements_values->map() == |
| isolate()->heap()->fixed_cow_array_map()) { |
| FastCloneShallowArrayStub stub( |
| @@ -1726,16 +1748,14 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
| __ IncrementCounter( |
| isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2); |
| } else if (expr->depth() > 1) { |
|
danno
2013/02/08 13:44:38
but push them here...
mvstanton
2013/02/11 11:11:24
Done.
|
| - __ CallRuntime(Runtime::kCreateArrayLiteral, 3); |
| + __ CallRuntime(Runtime::kCreateArrayLiteral, 4); |
| } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
|
danno
2013/02/08 13:44:38
and here...
mvstanton
2013/02/11 11:11:24
Done.
|
| - __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3); |
| + __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 4); |
| } else { |
| ASSERT(IsFastSmiOrObjectElementsKind(constant_elements_kind) || |
|
danno
2013/02/08 13:44:38
But not here...
mvstanton
2013/02/11 11:11:24
Done.
|
| 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; |