Revision: 21985
Author: [email protected]
Date: Tue Jun 24 15:56:36 2014 UTC
Log: More Map methods moved to private part.
[email protected]
Review URL: https://codereview.chromium.org/350023002
http://code.google.com/p/v8/source/detail?r=21985
Modified:
/branches/bleeding_edge/src/api.cc
/branches/bleeding_edge/src/objects.cc
/branches/bleeding_edge/src/objects.h
/branches/bleeding_edge/src/runtime.cc
=======================================
--- /branches/bleeding_edge/src/api.cc Tue Jun 24 14:53:48 2014 UTC
+++ /branches/bleeding_edge/src/api.cc Tue Jun 24 15:56:36 2014 UTC
@@ -3432,7 +3432,7 @@
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;
}
=======================================
--- /branches/bleeding_edge/src/objects.cc Tue Jun 24 15:28:29 2014 UTC
+++ /branches/bleeding_edge/src/objects.cc Tue Jun 24 15:56:36 2014 UTC
@@ -2123,7 +2123,7 @@
}
-// 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 @@
}
-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(
@@ -3994,10 +3993,10 @@
}
-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);
@@ -4024,10 +4023,10 @@
}
-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);
@@ -4677,8 +4676,8 @@
}
-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();
@@ -9913,7 +9912,7 @@
// 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);
}
}
=======================================
--- /branches/bleeding_edge/src/objects.h Tue Jun 24 15:28:29 2014 UTC
+++ /branches/bleeding_edge/src/objects.h Tue Jun 24 15:56:36 2014 UTC
@@ -2426,13 +2426,7 @@
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
@@ -2448,8 +2442,8 @@
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,
@@ -2638,6 +2632,23 @@
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);
=======================================
--- /branches/bleeding_edge/src/runtime.cc Tue Jun 24 09:31:30 2014 UTC
+++ /branches/bleeding_edge/src/runtime.cc Tue Jun 24 15:56:36 2014 UTC
@@ -310,7 +310,7 @@
// 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 @@
// 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 @@
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.