From: ishell@chromium.org Date: Tue, 24 Jun 2014 15:56:36 +0000 (+0000) Subject: More Map methods moved to private part. X-Git-Tag: upstream/4.7.83~8565 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=80e1bf42e5fb21babed79b4ddb3964e24b0d4ba5;p=platform%2Fupstream%2Fv8.git More Map methods moved to private part. R=verwaest@chromium.org Review URL: https://codereview.chromium.org/350023002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21985 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/api.cc b/src/api.cc index 7c60252..92aa745 100644 --- a/src/api.cc +++ b/src/api.cc @@ -3432,7 +3432,7 @@ static inline bool ObjectSetAccessor(Object* obj, i::JSObject::SetAccessor(Utils::OpenHandle(obj), info), false); if (result->IsUndefined()) return false; - if (fast) i::JSObject::TransformToFastProperties(Utils::OpenHandle(obj), 0); + if (fast) i::JSObject::MigrateSlowToFast(Utils::OpenHandle(obj), 0); return true; } diff --git a/src/objects.cc b/src/objects.cc index 2f6f86b..08a192f 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -2123,7 +2123,7 @@ void JSObject::MigrateToMap(Handle object, Handle new_map) { } -// To migrate an fast instance to a fast map: +// To migrate a fast instance to a fast map: // - First check whether the instance needs to be rewritten. If not, simply // change the map. // - Otherwise, allocate a fixed array large enough to hold all fields, in @@ -3979,8 +3979,7 @@ void JSObject::WriteToField(int descriptor, Object* value) { } -static void SetPropertyToField(LookupResult* lookup, - Handle value) { +void JSObject::SetPropertyToField(LookupResult* lookup, Handle value) { if (lookup->type() == CONSTANT || !lookup->CanHoldValue(value)) { Representation field_representation = value->OptimalRepresentation(); Handle field_type = value->OptimalType( @@ -3994,10 +3993,10 @@ static void SetPropertyToField(LookupResult* lookup, } -static void ConvertAndSetOwnProperty(LookupResult* lookup, - Handle name, - Handle value, - PropertyAttributes attributes) { +void JSObject::ConvertAndSetOwnProperty(LookupResult* lookup, + Handle name, + Handle value, + PropertyAttributes attributes) { Handle object(lookup->holder()); if (object->TooManyFastProperties()) { JSObject::NormalizeProperties(object, CLEAR_INOBJECT_PROPERTIES, 0); @@ -4024,10 +4023,10 @@ static void ConvertAndSetOwnProperty(LookupResult* lookup, } -static void SetPropertyToFieldWithAttributes(LookupResult* lookup, - Handle name, - Handle value, - PropertyAttributes attributes) { +void JSObject::SetPropertyToFieldWithAttributes(LookupResult* lookup, + Handle name, + Handle value, + PropertyAttributes attributes) { if (lookup->GetAttributes() == attributes) { if (value->IsUninitialized()) return; SetPropertyToField(lookup, value); @@ -4677,8 +4676,8 @@ void JSObject::MigrateFastToSlow(Handle object, } -void JSObject::TransformToFastProperties(Handle object, - int unused_property_fields) { +void JSObject::MigrateSlowToFast(Handle object, + int unused_property_fields) { if (object->HasFastProperties()) return; ASSERT(!object->IsGlobalObject()); Isolate* isolate = object->GetIsolate(); @@ -9913,7 +9912,7 @@ void JSObject::OptimizeAsPrototype(Handle object) { // Make sure prototypes are fast objects and their maps have the bit set // so they remain fast. if (!object->HasFastProperties()) { - TransformToFastProperties(object, 0); + MigrateSlowToFast(object, 0); } } diff --git a/src/objects.h b/src/objects.h index 4b73147..259f60d 100644 --- a/src/objects.h +++ b/src/objects.h @@ -2426,13 +2426,7 @@ class JSObject: public JSReceiver { static void TransitionElementsKind(Handle object, ElementsKind to_kind); - // TODO(mstarzinger): Both public because of ConvertAndSetOwnProperty(). static void MigrateToMap(Handle object, Handle new_map); - static void GeneralizeFieldRepresentation(Handle object, - int modify_index, - Representation new_representation, - Handle new_field_type, - StoreMode store_mode); // Convert the object to use the canonical dictionary // representation. If the object is expected to have additional properties @@ -2448,8 +2442,8 @@ class JSObject: public JSReceiver { Handle object); // Transform slow named properties to fast variants. - static void TransformToFastProperties(Handle object, - int unused_property_fields); + static void MigrateSlowToFast(Handle object, + int unused_property_fields); // Access fast-case object properties at index. static Handle FastPropertyAt(Handle object, @@ -2638,6 +2632,23 @@ class JSObject: public JSReceiver { Handle new_map, int expected_additional_properties); + static void SetPropertyToField(LookupResult* lookup, Handle value); + + static void ConvertAndSetOwnProperty(LookupResult* lookup, + Handle name, + Handle value, + PropertyAttributes attributes); + + static void SetPropertyToFieldWithAttributes(LookupResult* lookup, + Handle name, + Handle value, + PropertyAttributes attributes); + static void GeneralizeFieldRepresentation(Handle object, + int modify_index, + Representation new_representation, + Handle new_field_type, + StoreMode store_mode); + static void UpdateAllocationSite(Handle object, ElementsKind to_kind); diff --git a/src/runtime.cc b/src/runtime.cc index bd0b742..6d7fca9 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -310,7 +310,7 @@ MUST_USE_RESULT static MaybeHandle CreateObjectLiteralBoilerplate( // computed properties have been assigned so that we can generate // constant function properties. if (should_transform && !has_function_literal) { - JSObject::TransformToFastProperties( + JSObject::MigrateSlowToFast( boilerplate, boilerplate->map()->unused_property_fields()); } @@ -5055,7 +5055,7 @@ RUNTIME_FUNCTION(Runtime_DefineOrRedefineAccessorProperty) { // DefineAccessor checks access rights. JSObject::DefineAccessor(obj, name, getter, setter, attr); RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate); - if (fast) JSObject::TransformToFastProperties(obj, 0); + if (fast) JSObject::MigrateSlowToFast(obj, 0); return isolate->heap()->undefined_value(); } @@ -6036,7 +6036,7 @@ RUNTIME_FUNCTION(Runtime_ToFastProperties) { ASSERT(args.length() == 1); CONVERT_ARG_HANDLE_CHECKED(Object, object, 0); if (object->IsJSObject() && !object->IsGlobalObject()) { - JSObject::TransformToFastProperties(Handle::cast(object), 0); + JSObject::MigrateSlowToFast(Handle::cast(object), 0); } return *object; }