| Index: src/transitions.h
|
| diff --git a/src/transitions.h b/src/transitions.h
|
| index 52a043ce096d837db9e49ef1a214d4591f78bf9c..63e52badcdf4a96066e710dbfe20cd848b44b05e 100644
|
| --- a/src/transitions.h
|
| +++ b/src/transitions.h
|
| @@ -72,9 +72,9 @@ class TransitionArray: public FixedArray {
|
| inline void ClearElementsTransition();
|
|
|
| inline DescriptorArray* descriptors();
|
| - inline void set_descriptors(DescriptorArray* descriptors);
|
| - inline JSGlobalPropertyCell* descriptors_pointer();
|
| - inline void set_descriptors_pointer(JSGlobalPropertyCell* pointer);
|
| + inline void set_descriptors(DescriptorArray* descriptors,
|
| + WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
|
| + inline Object** GetDescriptorsSlot();
|
|
|
| inline Object* back_pointer_storage();
|
| inline void set_back_pointer_storage(
|
| @@ -91,7 +91,7 @@ class TransitionArray: public FixedArray {
|
|
|
| // Returns the number of transitions in the array.
|
| int number_of_transitions() {
|
| - if (IsSimpleTransition()) return 1;
|
| + ASSERT(length() >= kFirstIndex);
|
| int len = length();
|
| return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kTransitionSize;
|
| }
|
| @@ -99,17 +99,7 @@ class TransitionArray: public FixedArray {
|
| inline int number_of_entries() { return number_of_transitions(); }
|
|
|
| // Allocate a new transition array with a single entry.
|
| - static MUST_USE_RESULT MaybeObject* NewWith(
|
| - SimpleTransitionFlag flag,
|
| - String* key,
|
| - Map* target,
|
| - JSGlobalPropertyCell* descriptor_pointer,
|
| - Object* back_pointer);
|
| -
|
| - static MUST_USE_RESULT MaybeObject* AllocateDescriptorsHolder(
|
| - JSGlobalPropertyCell* descriptor_pointer);
|
| -
|
| - MUST_USE_RESULT MaybeObject* ExtendToFullTransitionArray();
|
| + static MUST_USE_RESULT MaybeObject* NewWith(String* name, Map* target);
|
|
|
| // Copy the transition array, inserting a new transition.
|
| // TODO(verwaest): This should not cause an existing transition to be
|
| @@ -117,21 +107,16 @@ class TransitionArray: public FixedArray {
|
| MUST_USE_RESULT MaybeObject* CopyInsert(String* name, Map* target);
|
|
|
| // Copy a single transition from the origin array.
|
| - inline void NoIncrementalWriteBarrierCopyFrom(TransitionArray* origin,
|
| - int origin_transition,
|
| - int target_transition);
|
| + inline void CopyFrom(TransitionArray* origin,
|
| + int origin_transition,
|
| + int target_transition,
|
| + const WhitenessWitness& witness);
|
|
|
| // Search a transition for a given property name.
|
| inline int Search(String* name);
|
|
|
| // Allocates a TransitionArray.
|
| - MUST_USE_RESULT static MaybeObject* Allocate(
|
| - int number_of_transitions,
|
| - JSGlobalPropertyCell* descriptors_cell);
|
| -
|
| - bool IsDescriptorsHolder() { return length() == kDescriptorsHolderSize; }
|
| - bool IsSimpleTransition() { return length() == kSimpleTransitionSize; }
|
| - bool IsFullTransitionArray() { return length() >= kFirstIndex; }
|
| + MUST_USE_RESULT static MaybeObject* Allocate(int number_of_transitions);
|
|
|
| // Casting.
|
| static inline TransitionArray* cast(Object* obj);
|
| @@ -139,32 +124,22 @@ class TransitionArray: public FixedArray {
|
| // Constant for denoting key was not found.
|
| static const int kNotFound = -1;
|
|
|
| - static const int kDescriptorsPointerIndex = 0;
|
| + static const int kDescriptorsIndex = 0;
|
| static const int kBackPointerStorageIndex = 1;
|
| - static const int kDescriptorsHolderSize = 2;
|
| -
|
| - // Layout for full transition arrays.
|
| static const int kElementsTransitionIndex = 2;
|
| static const int kPrototypeTransitionsIndex = 3;
|
| static const int kFirstIndex = 4;
|
|
|
| - // Layout for simple transition arrays.
|
| - static const int kSimpleTransitionTarget = 2;
|
| - static const int kSimpleTransitionSize = 3;
|
| - static const int kSimpleTransitionIndex = 0;
|
| - STATIC_ASSERT(kSimpleTransitionIndex != kNotFound);
|
| -
|
| - static const int kDescriptorsPointerOffset = FixedArray::kHeaderSize;
|
| - static const int kBackPointerStorageOffset = kDescriptorsPointerOffset +
|
| + // Layout transition array header.
|
| + static const int kDescriptorsOffset = FixedArray::kHeaderSize;
|
| + static const int kBackPointerStorageOffset = kDescriptorsOffset +
|
| kPointerSize;
|
| -
|
| - // Layout for the full transition array header.
|
| static const int kElementsTransitionOffset = kBackPointerStorageOffset +
|
| kPointerSize;
|
| static const int kPrototypeTransitionsOffset = kElementsTransitionOffset +
|
| kPointerSize;
|
|
|
| - // Layout of map transition entries in full transition arrays.
|
| + // Layout of map transition.
|
| static const int kTransitionKey = 0;
|
| static const int kTransitionTarget = 1;
|
| static const int kTransitionSize = 2;
|
| @@ -178,7 +153,7 @@ class TransitionArray: public FixedArray {
|
| #endif
|
|
|
| #ifdef DEBUG
|
| - bool IsSortedNoDuplicates(int valid_entries = -1);
|
| + bool IsSortedNoDuplicates();
|
| bool IsConsistentWithBackPointers(Map* current_map);
|
| bool IsEqualTo(TransitionArray* other);
|
| #endif
|
| @@ -201,9 +176,10 @@ class TransitionArray: public FixedArray {
|
| kTransitionTarget;
|
| }
|
|
|
| - inline void NoIncrementalWriteBarrierSet(int transition_number,
|
| - String* key,
|
| - Map* target);
|
| + inline void Set(int transition_number,
|
| + String* key,
|
| + Map* target,
|
| + const WhitenessWitness&);
|
|
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray);
|
| };
|
|
|