Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: src/transitions.h

Issue 11188031: Move DescriptorArray into the map (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: remove padding area Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/spaces.h ('k') | src/transitions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/transitions.h
diff --git a/src/transitions.h b/src/transitions.h
index 9643a61812b8feca8bfdc8b9dccc7fe1acc8dc72..0a660261c58735e2fe8511e2ff8903caf919bdd5 100644
--- a/src/transitions.h
+++ b/src/transitions.h
@@ -39,13 +39,22 @@ namespace internal {
// TransitionArrays are fixed arrays used to hold map transitions for property,
-// constant, and element changes.
-// The format of the these objects is:
-// [0] Descriptor array
-// [1] Undefined or back pointer map
-// [2] Smi(0) or elements transition map
-// [3] Smi(0) or fixed array of prototype transitions
-// [4] First transition
+// constant, and element changes. They can either be simple transition arrays
+// that store a single property transition, or a full transition array that has
+// space for elements transitions, prototype transitions and multiple property
+// transitons. The details related to property transitions are accessed in the
+// descriptor array of the target map. In the case of a simple transition, the
+// key is also read from the descriptor array of the target map.
+//
+// The simple format of the these objects is:
+// [0] Undefined or back pointer map
+// [1] Single transition
+//
+// The full format is:
+// [0] Undefined or back pointer map
+// [1] Smi(0) or elements transition map
+// [2] Smi(0) or fixed array of prototype transitions
+// [3] First transition
// [length() - kTransitionSize] Last transition
class TransitionArray: public FixedArray {
public:
@@ -71,10 +80,6 @@ class TransitionArray: public FixedArray {
inline bool HasElementsTransition();
inline void ClearElementsTransition();
- inline Object** GetDescriptorsSlot();
- inline DescriptorArray* descriptors();
- inline void set_descriptors(DescriptorArray* descriptors);
-
inline Object* back_pointer_storage();
inline void set_back_pointer_storage(
Object* back_pointer,
@@ -102,11 +107,8 @@ class TransitionArray: public FixedArray {
SimpleTransitionFlag flag,
String* key,
Map* target,
- DescriptorArray* descriptors,
Object* back_pointer);
- static MUST_USE_RESULT MaybeObject* AllocateDescriptorsHolder();
-
MUST_USE_RESULT MaybeObject* ExtendToFullTransitionArray();
// Copy the transition array, inserting a new transition.
@@ -125,7 +127,6 @@ class TransitionArray: public FixedArray {
// Allocates a TransitionArray.
MUST_USE_RESULT static MaybeObject* Allocate(int number_of_transitions);
- bool IsDescriptorsHolder() { return length() == kDescriptorsHolderSize; }
bool IsSimpleTransition() { return length() == kSimpleTransitionSize; }
bool IsFullTransitionArray() { return length() >= kFirstIndex; }
@@ -135,24 +136,20 @@ class TransitionArray: public FixedArray {
// Constant for denoting key was not found.
static const int kNotFound = -1;
- static const int kDescriptorsIndex = 0;
- static const int kBackPointerStorageIndex = 1;
- static const int kDescriptorsHolderSize = 2;
+ static const int kBackPointerStorageIndex = 0;
// Layout for full transition arrays.
- static const int kElementsTransitionIndex = 2;
- static const int kPrototypeTransitionsIndex = 3;
- static const int kFirstIndex = 4;
+ static const int kElementsTransitionIndex = 1;
+ static const int kPrototypeTransitionsIndex = 2;
+ static const int kFirstIndex = 3;
// Layout for simple transition arrays.
- static const int kSimpleTransitionTarget = 2;
- static const int kSimpleTransitionSize = 3;
+ static const int kSimpleTransitionTarget = 1;
+ static const int kSimpleTransitionSize = 2;
static const int kSimpleTransitionIndex = 0;
STATIC_ASSERT(kSimpleTransitionIndex != kNotFound);
- static const int kDescriptorsOffset = FixedArray::kHeaderSize;
- static const int kBackPointerStorageOffset = kDescriptorsOffset +
- kPointerSize;
+ static const int kBackPointerStorageOffset = FixedArray::kHeaderSize;
// Layout for the full transition array header.
static const int kElementsTransitionOffset = kBackPointerStorageOffset +
« no previous file with comments | « src/spaces.h ('k') | src/transitions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698