Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 1ee612b5325e2a51e55ba6ed398b9d1ab14b6184..08e308990770c5d9c93f4c25704480915bb57603 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1634,6 +1634,9 @@ void FullCodeGenerator::EmitAccessor(Expression* expression) { |
void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
Comment cmnt(masm_, "[ ObjectLiteral"); |
+ |
+ int depth = 1; |
+ expr->BuildConstantProperties(isolate(), &depth); |
Handle<FixedArray> constant_properties = expr->constant_properties(); |
__ ldr(r3, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
__ ldr(r3, FieldMemOperand(r3, JSFunction::kLiteralsOffset)); |
@@ -1648,7 +1651,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
__ mov(r0, Operand(Smi::FromInt(flags))); |
int properties_count = constant_properties->length() / 2; |
if ((FLAG_track_double_fields && expr->may_store_doubles()) || |
- expr->depth() > 1 || Serializer::enabled() || |
+ depth > 1 || Serializer::enabled() || |
flags != ObjectLiteral::kFastElements || |
properties_count > FastCloneShallowObjectStub::kMaximumClonedProperties) { |
__ Push(r3, r2, r1, r0); |
@@ -1767,6 +1770,8 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { |
void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
Comment cmnt(masm_, "[ ArrayLiteral"); |
+ int depth = 1; |
+ expr->BuildConstantElements(isolate(), &depth); |
ZoneList<Expression*>* subexprs = expr->values(); |
int length = subexprs->length(); |
Handle<FixedArray> constant_elements = expr->constant_elements(); |
@@ -1790,8 +1795,7 @@ void FullCodeGenerator::VisitArrayLiteral(ArrayLiteral* expr) { |
__ CallStub(&stub); |
__ IncrementCounter( |
isolate()->counters()->cow_arrays_created_stub(), 1, r1, r2); |
- } else if (expr->depth() > 1 || |
- Serializer::enabled() || |
+ } else if (depth > 1 || Serializer::enabled() || |
length > FastCloneShallowArrayStub::kMaximumClonedLength) { |
__ Push(r3, r2, r1); |
__ CallRuntime(Runtime::kCreateArrayLiteral, 3); |