Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 99687caf91e9963727301762e6ce2d2f61af1974..ceb3a61176a42ad0a8ff62878c2c1c0565eeb79d 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -4335,15 +4335,23 @@ void HOptimizedGraphBuilder::VisitObjectLiteral(ObjectLiteral* expr) { |
| // Check whether to use fast or slow deep-copying for boilerplate. |
| int max_properties = kMaxFastLiteralProperties; |
| - Handle<Object> boilerplate(closure->literals()->get( |
| - expr->literal_index()), isolate()); |
| - if (boilerplate->IsJSObject() && |
| - IsFastLiteral(Handle<JSObject>::cast(boilerplate), |
| + Handle<Object> literals_cell(closure->literals()->get(expr->literal_index()), |
| + isolate()); |
| + Handle<AllocationSite> site; |
| + Handle<JSObject> boilerplate; |
| + if (!literals_cell->IsUndefined()) { |
| + // Retrieve the boilerplate |
| + ASSERT(literals_cell->IsAllocationSite()); |
|
Michael Starzinger
2013/10/11 07:49:37
nit: Assert is not needed, the cast below will do
mvstanton
2013/10/11 09:23:47
Done.
|
| + site = Handle<AllocationSite>::cast(literals_cell); |
| + boilerplate = Handle<JSObject>(JSObject::cast(site->transition_info()), |
| + isolate()); |
| + } |
| + |
| + if (!boilerplate.is_null() && |
| + IsFastLiteral(boilerplate, |
|
Michael Starzinger
2013/10/11 07:49:37
nit: Second predicate should fit into one line now
mvstanton
2013/10/11 09:23:47
Done.
|
| kMaxFastLiteralDepth, |
| &max_properties)) { |
| - Handle<JSObject> boilerplate_object = Handle<JSObject>::cast(boilerplate); |
| - |
| - literal = BuildFastLiteral(boilerplate_object); |
| + literal = BuildFastLiteral(boilerplate); |
| } else { |
| NoObservableSideEffectsScope no_effects(this); |
| Handle<FixedArray> closure_literals(closure->literals(), isolate()); |