Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 4389bfe78ab391c44a24a8ab36874e57968046cf..cde901cad550be96568157e64048b6514457bdc9 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5552,19 +5552,13 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
Handle<FixedArray> closure_literals(closure->literals(), isolate()); |
Handle<FixedArray> constant_properties = expr->constant_properties(); |
int literal_index = expr->literal_index(); |
- int flags = expr->fast_elements() |
- ? ObjectLiteral::kFastElements : ObjectLiteral::kNoFlags; |
- flags |= expr->has_function() |
- ? ObjectLiteral::kHasFunction : ObjectLiteral::kNoFlags; |
+ int flags = expr->ComputeFlags(true); |
Add<HPushArguments>(Add<HConstant>(closure_literals), |
Add<HConstant>(literal_index), |
Add<HConstant>(constant_properties), |
Add<HConstant>(flags)); |
- // TODO(mvstanton): Add a flag to turn off creation of any |
- // AllocationMementos for this call: we are in crankshaft and should have |
- // learned enough about transition behavior to stop emitting mementos. |
Runtime::FunctionId function_id = Runtime::kCreateObjectLiteral; |
literal = Add<HCallRuntime>(isolate()->factory()->empty_string(), |
Runtime::FunctionForId(function_id), |
@@ -5723,10 +5717,7 @@ void HOptimizedGraphBuilder::VisitArrayLiteral(ArrayLiteral* expr) { |
// pass an empty fixed array to the runtime function instead. |
Handle<FixedArray> constants = isolate()->factory()->empty_fixed_array(); |
int literal_index = expr->literal_index(); |
- int flags = expr->depth() == 1 |
- ? ArrayLiteral::kShallowElements |
- : ArrayLiteral::kNoFlags; |
- flags |= ArrayLiteral::kDisableMementos; |
+ int flags = expr->ComputeFlags(true); |
Add<HPushArguments>(Add<HConstant>(literals), |
Add<HConstant>(literal_index), |