| Index: src/ia32/full-codegen-ia32.cc
|
| diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
|
| index ebc3a2bd5cae7dc672170f66aa27c42ba98fa71c..fec8d06f3726d732fe5eeda6327d19a1bbffd0bb 100644
|
| --- a/src/ia32/full-codegen-ia32.cc
|
| +++ b/src/ia32/full-codegen-ia32.cc
|
| @@ -1527,12 +1527,19 @@ void FullCodeGenerator::EmitAccessor(Expression* expression) {
|
| void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
|
| Comment cmnt(masm_, "[ ObjectLiteral");
|
| Handle<FixedArray> constant_properties = expr->constant_properties();
|
| +
|
| int flags = expr->fast_elements()
|
| ? ObjectLiteral::kFastElements
|
| : ObjectLiteral::kNoFlags;
|
| 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;
|
| + }
|
| +
|
| int properties_count = constant_properties->length() / 2;
|
| if (expr->depth() > 1) {
|
| __ mov(edi, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
| @@ -1670,6 +1677,19 @@ 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)));
|
| +
|
| __ mov(ebx, Operand(ebp, JavaScriptFrameConstants::kFunctionOffset));
|
| __ push(FieldOperand(ebx, JSFunction::kLiteralsOffset));
|
| __ push(Immediate(Smi::FromInt(expr->literal_index())));
|
| @@ -1686,16 +1706,16 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) {
|
| length);
|
| __ CallStub(&stub);
|
| } else if (expr->depth() > 1) {
|
| - __ CallRuntime(Runtime::kCreateArrayLiteral, 3);
|
| + __ push(Immediate(Smi::FromInt(flags)));
|
| + __ CallRuntime(Runtime::kCreateArrayLiteral, 4);
|
| } else if (length > FastCloneShallowArrayStub::kMaximumClonedLength) {
|
| - __ CallRuntime(Runtime::kCreateArrayLiteralShallow, 3);
|
| + __ push(Immediate(Smi::FromInt(flags)));
|
| + __ 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 the elements are already FAST_*_ELEMENTS, the boilerplate cannot
|
| // change, so it's possible to specialize the stub in advance.
|
|
|