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 + |