Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 99687caf91e9963727301762e6ce2d2f61af1974..1d129d5e245d1f3145f1b74df5363c5bf7be82c3 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -4335,9 +4335,18 @@ 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() && |
+ Handle<Object> literals_cell(closure->literals()->get(expr->literal_index()), |
+ isolate()); |
+ Handle<AllocationSite> site; |
+ Handle<Object> boilerplate; |
Michael Starzinger
2013/10/10 13:27:39
nit: The type of "boilerplate" should be Handle<JS
mvstanton
2013/10/10 14:09:04
Done.
|
+ if (!literals_cell->IsUndefined()) { |
+ // Retrieve the boilerplate |
+ ASSERT(literals_cell->IsAllocationSite()); |
+ site = Handle<AllocationSite>::cast(literals_cell); |
+ boilerplate = Handle<Object>(site->transition_info(), isolate()); |
+ } |
+ |
+ if (!boilerplate.is_null() && |
IsFastLiteral(Handle<JSObject>::cast(boilerplate), |
kMaxFastLiteralDepth, |
&max_properties)) { |