| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index 26dc36d5300fc44e3ca094389a9d05b2a2f20913..f88b1980d362a56b14e3d613d106154a7d8b3733 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -486,16 +486,24 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_CreateObjectLiteral) {
|
| bool has_function_literal = (flags & ObjectLiteral::kHasFunction) != 0;
|
|
|
| // Check if boilerplate exists. If not, create it first.
|
| - Handle<Object> boilerplate(literals->get(literals_index), isolate);
|
| - if (*boilerplate == isolate->heap()->undefined_value()) {
|
| + Handle<Object> literal_site(literals->get(literals_index), isolate);
|
| + Handle<AllocationSite> site;
|
| + Handle<Object> boilerplate;
|
| + if (*literal_site == isolate->heap()->undefined_value()) {
|
| boilerplate = CreateObjectLiteralBoilerplate(isolate,
|
| literals,
|
| constant_properties,
|
| should_have_fast_elements,
|
| has_function_literal);
|
| RETURN_IF_EMPTY_HANDLE(isolate, boilerplate);
|
| + site = isolate->factory()->NewAllocationSite();
|
| + site->set_transition_info(*boilerplate);
|
| +
|
| // Update the functions literal and return the boilerplate.
|
| - literals->set(literals_index, *boilerplate);
|
| + literals->set(literals_index, *site);
|
| + } else {
|
| + site = Handle<AllocationSite>::cast(literal_site);
|
| + boilerplate = Handle<JSObject>(JSObject::cast(site->transition_info()));
|
| }
|
|
|
| Handle<Object> copy = JSObject::DeepCopy(Handle<JSObject>::cast(boilerplate));
|
|
|