Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index cd1af05d578d59dd268d3adfc289388e143cf551..db93f6b731ac5bb6ab69de490c4c295f21172312 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 |
|
danno
2013/04/25 13:33:48
Elaborate, please :-) (fast)
Toon Verwaest
2013/04/25 14:49:10
Done.
|
| + // 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,8 @@ 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 tracking representations in the boilerplate. |
|
danno
2013/04/25 13:33:48
Remove all this code, insert TODO
Toon Verwaest
2013/04/25 14:49:10
Done.
|
| } |
| Handle<Object> result; |
| uint32_t element_index = 0; |
| @@ -299,7 +306,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 +2302,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,20 +7491,6 @@ 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); |
| - } |
| -} |
| - |
| - |
| RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) { |
| HandleScope scope(isolate); |
| ASSERT(args.length() == 1); |
| @@ -7560,13 +7554,8 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_NewObject) { |
| shared->CompleteInobjectSlackTracking(); |
| } |
| - 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); |
| - } |
| isolate->counters()->constructed_objects()->Increment(); |
| isolate->counters()->constructed_objects_runtime()->Increment(); |
| @@ -7581,7 +7570,6 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_FinalizeInstanceSize) { |
| CONVERT_ARG_HANDLE_CHECKED(JSFunction, function, 0); |
| function->shared()->CompleteInobjectSlackTracking(); |
| - TrySettingInlineConstructStub(isolate, function); |
| return isolate->heap()->undefined_value(); |
| } |
| @@ -10057,7 +10045,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 +13235,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. |