| Index: src/runtime.cc
|
| diff --git a/src/runtime.cc b/src/runtime.cc
|
| index cd1af05d578d59dd268d3adfc289388e143cf551..8af54eb33a9ac288ea511cd6b672fb5aec8199ec 100644
|
| --- a/src/runtime.cc
|
| +++ b/src/runtime.cc
|
| @@ -249,6 +249,11 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
|
| boilerplate, KEEP_INOBJECT_PROPERTIES, length / 2);
|
| }
|
|
|
| + // TODO(verwaest): This does not catch the case where the object stays in fast
|
| + // most from the beginning. However, since it may go slow by adding
|
| + // properties, currently only assume we'll ever be fast if we ensure
|
| + // converting it back to fast mode.
|
| + bool will_be_fast = should_transform && !has_function_literal;
|
| for (int index = 0; index < length; index +=2) {
|
| Handle<Object> key(constant_properties->get(index+0), isolate);
|
| Handle<Object> value(constant_properties->get(index+1), isolate);
|
| @@ -258,6 +263,13 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
|
| Handle<FixedArray> array = Handle<FixedArray>::cast(value);
|
| value = CreateLiteralBoilerplate(isolate, literals, array);
|
| if (value.is_null()) return value;
|
| + } else if (value->IsUndefined()) {
|
| + // TODO(verwaest): Support storage types in the boilerplate.
|
| + // if (will_be_fast) {
|
| + // value = isolate->factory()->the_hole_value();
|
| + // } else {
|
| + // value = Handle<Object>(Smi::FromInt(0), isolate);
|
| + // }
|
| }
|
| Handle<Object> result;
|
| uint32_t element_index = 0;
|
| @@ -299,7 +311,7 @@ static Handle<Object> CreateObjectLiteralBoilerplate(
|
| // containing function literals we defer this operation until after all
|
| // computed properties have been assigned so that we can generate
|
| // constant function properties.
|
| - if (should_transform && !has_function_literal) {
|
| + if (will_be_fast) {
|
| JSObject::TransformToFastProperties(
|
| boilerplate, boilerplate->map()->unused_property_fields());
|
| }
|
| @@ -2295,6 +2307,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FunctionSetReadOnlyPrototype) {
|
| PropertyDetails new_details(
|
| static_cast<PropertyAttributes>(details.attributes() | READ_ONLY),
|
| details.type(),
|
| + Representation::None(),
|
| details.dictionary_index());
|
| function->property_dictionary()->DetailsAtPut(entry, new_details);
|
| }
|
| @@ -7483,18 +7496,18 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObjectFromBound) {
|
| }
|
|
|
|
|
| -static void TrySettingInlineConstructStub(Isolate* isolate,
|
| - Handle<JSFunction> function) {
|
| - Handle<Object> prototype = isolate->factory()->null_value();
|
| - if (function->has_instance_prototype()) {
|
| - prototype = Handle<Object>(function->instance_prototype(), isolate);
|
| - }
|
| - if (function->shared()->CanGenerateInlineConstructor(*prototype)) {
|
| - ConstructStubCompiler compiler(isolate);
|
| - Handle<Code> code = compiler.CompileConstructStub(function);
|
| - function->shared()->set_construct_stub(*code);
|
| - }
|
| -}
|
| +// static void TrySettingInlineConstructStub(Isolate* isolate,
|
| +// Handle<JSFunction> function) {
|
| +// Handle<Object> prototype = isolate->factory()->null_value();
|
| +// if (function->has_instance_prototype()) {
|
| +// prototype = Handle<Object>(function->instance_prototype(), isolate);
|
| +// }
|
| +// if (function->shared()->CanGenerateInlineConstructor(*prototype)) {
|
| +// ConstructStubCompiler compiler(isolate);
|
| +// Handle<Code> code = compiler.CompileConstructStub(function);
|
| +// function->shared()->set_construct_stub(*code);
|
| +// }
|
| +// }
|
|
|
|
|
| RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) {
|
| @@ -7560,13 +7573,13 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) {
|
| shared->CompleteInobjectSlackTracking();
|
| }
|
|
|
| - bool first_allocation = !shared->live_objects_may_exist();
|
| + // bool first_allocation = !shared->live_objects_may_exist();
|
| Handle<JSObject> result = isolate->factory()->NewJSObject(function);
|
| RETURN_IF_EMPTY_HANDLE(isolate, result);
|
| // Delay setting the stub if inobject slack tracking is in progress.
|
| - if (first_allocation && !shared->IsInobjectSlackTrackingInProgress()) {
|
| - TrySettingInlineConstructStub(isolate, function);
|
| - }
|
| + // if (first_allocation && !shared->IsInobjectSlackTrackingInProgress()) {
|
| + // TrySettingInlineConstructStub(isolate, function);
|
| + // }
|
|
|
| isolate->counters()->constructed_objects()->Increment();
|
| isolate->counters()->constructed_objects_runtime()->Increment();
|
| @@ -7581,7 +7594,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FinalizeInstanceSize) {
|
|
|
| CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0);
|
| function->shared()->CompleteInobjectSlackTracking();
|
| - TrySettingInlineConstructStub(isolate, function);
|
| + // TrySettingInlineConstructStub(isolate, function);
|
|
|
| return isolate->heap()->undefined_value();
|
| }
|
| @@ -10057,7 +10070,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_DebugGetPropertyDetails) {
|
| }
|
| }
|
| details->set(0, element_or_char);
|
| - details->set(1, PropertyDetails(NONE, NORMAL).AsSmi());
|
| + details->set(
|
| + 1, PropertyDetails(NONE, NORMAL, Representation::None()).AsSmi());
|
| return *isolate->factory()->NewJSArrayWithElements(details);
|
| }
|
|
|
| @@ -13246,7 +13260,7 @@ MaybeObject* Runtime::InitializeIntrinsicFunctionNames(Heap* heap,
|
| { MaybeObject* maybe_dictionary = name_dictionary->Add(
|
| String::cast(name_string),
|
| Smi::FromInt(i),
|
| - PropertyDetails(NONE, NORMAL));
|
| + PropertyDetails(NONE, NORMAL, Representation::None()));
|
| if (!maybe_dictionary->ToObject(&dictionary)) {
|
| // Non-recoverable failure. Calling code must restart heap
|
| // initialization.
|
|
|