Reviewers: Toon Verwaest,

Message:
PTAL

Description:
More Map methods moved to private part.

Please review this at https://codereview.chromium.org/350023002/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+35, -25 lines):
  M src/api.cc
  M src/objects.h
  M src/objects.cc
  M src/runtime.cc


Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 7c60252156e3382c8d7ff28d7cdf4fb21b15de92..92aa745a65d6e913b4602df70dffa0e2700521e1 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;
 }

Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index dd4341b45558a94a9d6be3f69fff34839a9bf2ac..00495e3219b7f885c86e23872c95471eb02aad23 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3994,8 +3994,7 @@ void JSObject::WriteToField(int descriptor, Object* value) {
 }


-static void SetPropertyToField(LookupResult* lookup,
-                               Handle<Object> value) {
+void JSObject::SetPropertyToField(LookupResult* lookup, Handle<Object> value) {
   if (lookup->type() == CONSTANT || !lookup->CanHoldValue(value)) {
     Representation field_representation = value->OptimalRepresentation();
     Handle<HeapType> field_type = value->OptimalType(
@@ -4009,10 +4008,10 @@ static void SetPropertyToField(LookupResult* lookup,
 }


-static void ConvertAndSetOwnProperty(LookupResult* lookup,
-                                     Handle<Name> name,
-                                     Handle<Object> value,
-                                     PropertyAttributes attributes) {
+void JSObject::ConvertAndSetOwnProperty(LookupResult* lookup,
+                                        Handle<Name> name,
+                                        Handle<Object> value,
+                                        PropertyAttributes attributes) {
   Handle<JSObject> object(lookup->holder());
   if (object->TooManyFastProperties()) {
     JSObject::NormalizeProperties(object, CLEAR_INOBJECT_PROPERTIES, 0);
@@ -4039,10 +4038,10 @@ static void ConvertAndSetOwnProperty(LookupResult* lookup,
 }


-static void SetPropertyToFieldWithAttributes(LookupResult* lookup,
-                                             Handle<Name> name,
-                                             Handle<Object> value,
- PropertyAttributes attributes) {
+void JSObject::SetPropertyToFieldWithAttributes(LookupResult* lookup,
+                                                Handle<Name> name,
+                                                Handle<Object> value,
+ PropertyAttributes attributes) {
   if (lookup->GetAttributes() == attributes) {
     if (value->IsUninitialized()) return;
     SetPropertyToField(lookup, value);
@@ -4692,8 +4691,8 @@ void JSObject::MigrateFastToSlow(Handle<JSObject> object,
 }


-void JSObject::TransformToFastProperties(Handle<JSObject> object,
-                                         int unused_property_fields) {
+void JSObject::MigrateSlowToFast(Handle<JSObject> object,
+                                 int unused_property_fields) {
   if (object->HasFastProperties()) return;
   ASSERT(!object->IsGlobalObject());
   Isolate* isolate = object->GetIsolate();
@@ -9950,7 +9949,7 @@ void JSObject::OptimizeAsPrototype(Handle<JSObject> 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);
   }
 }

Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index e1587af290adadea8ca1966b4c151a6f50f901c7..4d56dd8d6e5f8ccf672679c6a048df76dfe86efb 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2425,13 +2425,7 @@ class JSObject: public JSReceiver {
   static void TransitionElementsKind(Handle<JSObject> object,
                                      ElementsKind to_kind);

-  // TODO(mstarzinger): Both public because of ConvertAndSetOwnProperty().
   static void MigrateToMap(Handle<JSObject> object, Handle<Map> new_map);
-  static void GeneralizeFieldRepresentation(Handle<JSObject> object,
-                                            int modify_index,
- Representation new_representation, - Handle<HeapType> new_field_type,
-                                            StoreMode store_mode);

   // Convert the object to use the canonical dictionary
// representation. If the object is expected to have additional properties
@@ -2447,8 +2441,8 @@ class JSObject: public JSReceiver {
       Handle<JSObject> object);

   // Transform slow named properties to fast variants.
-  static void TransformToFastProperties(Handle<JSObject> object,
-                                        int unused_property_fields);
+  static void MigrateSlowToFast(Handle<JSObject> object,
+                                int unused_property_fields);

   // Access fast-case object properties at index.
   static Handle<Object> FastPropertyAt(Handle<JSObject> object,
@@ -2637,6 +2631,23 @@ class JSObject: public JSReceiver {
                                 Handle<Map> new_map,
                                 int expected_additional_properties);

+ static void SetPropertyToField(LookupResult* lookup, Handle<Object> value);
+
+  static void ConvertAndSetOwnProperty(LookupResult* lookup,
+                                       Handle<Name> name,
+                                       Handle<Object> value,
+                                       PropertyAttributes attributes);
+
+  static void SetPropertyToFieldWithAttributes(LookupResult* lookup,
+                                               Handle<Name> name,
+                                               Handle<Object> value,
+ PropertyAttributes attributes);
+  static void GeneralizeFieldRepresentation(Handle<JSObject> object,
+                                            int modify_index,
+ Representation new_representation, + Handle<HeapType> new_field_type,
+                                            StoreMode store_mode);
+
   static void UpdateAllocationSite(Handle<JSObject> object,
                                    ElementsKind to_kind);

Index: src/runtime.cc
diff --git a/src/runtime.cc b/src/runtime.cc
index 3cb6fe20a20b752b42e042f33585459df27ef8aa..5136af1fbbb8880527bf18cf80c568453a5104eb 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -310,7 +310,7 @@ MUST_USE_RESULT static MaybeHandle<Object> 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<JSObject>::cast(object), 0);
+    JSObject::MigrateSlowToFast(Handle<JSObject>::cast(object), 0);
   }
   return *object;
 }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to