| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index f8e74ed58a65dbb258c54196c1d4c56c3b5fc0bd..8551b102300c9ceaf114f333970364409586f417 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -5551,19 +5551,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),
|
| @@ -5722,10 +5716,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),
|
|
|