Revision: 21940
Author: [email protected]
Date: Mon Jun 23 13:46:49 2014 UTC
Log: Several methods moved from JSObject to Map.
[email protected]
Review URL: https://codereview.chromium.org/349203002
http://code.google.com/p/v8/source/detail?r=21940
Modified:
/branches/bleeding_edge/src/json-parser.h
/branches/bleeding_edge/src/objects-inl.h
/branches/bleeding_edge/src/objects.h
=======================================
--- /branches/bleeding_edge/src/json-parser.h Tue Jun 10 14:01:08 2014 UTC
+++ /branches/bleeding_edge/src/json-parser.h Mon Jun 23 13:46:49 2014 UTC
@@ -358,19 +358,19 @@
bool follow_expected = false;
Handle<Map> target;
if (seq_ascii) {
- key = JSObject::ExpectedTransitionKey(map);
+ key = Map::ExpectedTransitionKey(map);
follow_expected = !key.is_null() && ParseJsonString(key);
}
// If the expected transition hits, follow it.
if (follow_expected) {
- target = JSObject::ExpectedTransitionTarget(map);
+ target = Map::ExpectedTransitionTarget(map);
} else {
// If the expected transition failed, parse an internalized
string and
// try to find a matching transition.
key = ParseJsonInternalizedString();
if (key.is_null()) return ReportUnexpectedCharacter();
- target = JSObject::FindTransitionToField(map, key);
+ target = Map::FindTransitionToField(map, key);
// If a transition was found, follow it and continue.
transitioning = !target.is_null();
}
=======================================
--- /branches/bleeding_edge/src/objects-inl.h Mon Jun 23 09:02:16 2014 UTC
+++ /branches/bleeding_edge/src/objects-inl.h Mon Jun 23 13:46:49 2014 UTC
@@ -1810,7 +1810,7 @@
}
-Handle<String> JSObject::ExpectedTransitionKey(Handle<Map> map) {
+Handle<String> Map::ExpectedTransitionKey(Handle<Map> map) {
DisallowHeapAllocation no_gc;
if (!map->HasTransitionArray()) return Handle<String>::null();
TransitionArray* transitions = map->transitions();
@@ -1825,14 +1825,14 @@
}
-Handle<Map> JSObject::ExpectedTransitionTarget(Handle<Map> map) {
+Handle<Map> Map::ExpectedTransitionTarget(Handle<Map> map) {
ASSERT(!ExpectedTransitionKey(map).is_null());
return Handle<Map>(map->transitions()->GetTarget(
TransitionArray::kSimpleTransitionIndex));
}
-Handle<Map> JSObject::FindTransitionToField(Handle<Map> map, Handle<Name>
key) {
+Handle<Map> Map::FindTransitionToField(Handle<Map> map, Handle<Name> key) {
DisallowHeapAllocation no_allocation;
if (!map->HasTransitionArray()) return Handle<Map>::null();
TransitionArray* transitions = map->transitions();
=======================================
--- /branches/bleeding_edge/src/objects.h Mon Jun 23 13:20:26 2014 UTC
+++ /branches/bleeding_edge/src/objects.h Mon Jun 23 13:46:49 2014 UTC
@@ -2152,14 +2152,6 @@
StoreFromKeyed store_mode = MAY_BE_STORE_FROM_KEYED,
ExecutableAccessorInfoHandling handling = DEFAULT_HANDLING);
- static inline Handle<String> ExpectedTransitionKey(Handle<Map> map);
- static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map);
-
- // Try to follow an existing transition to a field with attributes NONE.
The
- // return value indicates whether the transition was successful.
- static inline Handle<Map> FindTransitionToField(Handle<Map> map,
- Handle<Name> key);
-
// Extend the receiver with a single fast property appeared first in the
// passed map. This also extends the property backing store if necessary.
static void AllocateStorageForMap(Handle<JSObject> object, Handle<Map>
map);
@@ -6234,14 +6226,21 @@
inline bool HasTransitionArray() const;
inline bool HasElementsTransition();
inline Map* elements_transition_map();
- static Handle<TransitionArray> SetElementsTransitionMap(
- Handle<Map> map, Handle<Map> transitioned_map);
+
inline Map* GetTransition(int transition_index);
inline int SearchTransition(Name* name);
inline FixedArrayBase* GetInitialElements();
DECL_ACCESSORS(transitions, TransitionArray)
+ static inline Handle<String> ExpectedTransitionKey(Handle<Map> map);
+ static inline Handle<Map> ExpectedTransitionTarget(Handle<Map> map);
+
+ // Try to follow an existing transition to a field with attributes NONE.
The
+ // return value indicates whether the transition was successful.
+ static inline Handle<Map> FindTransitionToField(Handle<Map> map,
+ Handle<Name> key);
+
Map* FindRootMap();
Map* FindFieldOwner(int descriptor);
@@ -6249,15 +6248,17 @@
int NumberOfFields();
+ // TODO(ishell): candidate with JSObject::MigrateToMap().
bool InstancesNeedRewriting(Map* target,
int target_number_of_fields,
int target_inobject,
int target_unused);
+ // TODO(ishell): moveit!
static Handle<Map> GeneralizeAllFieldRepresentations(Handle<Map> map);
- static Handle<HeapType> GeneralizeFieldType(Handle<HeapType> type1,
- Handle<HeapType> type2,
- Isolate* isolate)
- V8_WARN_UNUSED_RESULT;
+ MUST_USE_RESULT static Handle<HeapType> GeneralizeFieldType(
+ Handle<HeapType> type1,
+ Handle<HeapType> type2,
+ Isolate* isolate);
static void GeneralizeFieldType(Handle<Map> map,
int modify_index,
Handle<HeapType> new_field_type);
@@ -6542,7 +6543,6 @@
// elements_kind that's found in |candidates|, or null handle if no
match is
// found at all.
Handle<Map> FindTransitionedMap(MapHandleList* candidates);
- Map* FindTransitionedMap(MapList* candidates);
bool CanTransition() {
// Only JSObject and subtypes have map transitions and back pointers.
@@ -6704,6 +6704,9 @@
bool EquivalentToForNormalization(Map* other, PropertyNormalizationMode
mode);
private:
+ static Handle<TransitionArray> SetElementsTransitionMap(
+ Handle<Map> map, Handle<Map> transitioned_map);
+
bool EquivalentToForTransition(Map* other);
static Handle<Map> RawCopy(Handle<Map> map, int instance_size);
static Handle<Map> ShareDescriptor(Handle<Map> map,
--
--
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.