| Index: src/objects.h
|
| diff --git a/src/objects.h b/src/objects.h
|
| index 7ed297340373326cc33c02e3d43173371bf1d04c..664273264254122fbe8aa7b7a50ba5032afafaac 100644
|
| --- a/src/objects.h
|
| +++ b/src/objects.h
|
| @@ -2475,15 +2475,10 @@ class DescriptorArray: public FixedArray {
|
| // map uses to encode additional bit fields when the descriptor array is not
|
| // yet used.
|
| inline bool IsEmpty();
|
| - inline bool MayContainTransitions();
|
| - inline bool HasTransitionArray();
|
| -
|
| - DECL_ACCESSORS(transitions, TransitionArray)
|
| - inline void ClearTransitions();
|
|
|
| // Returns the number of descriptors in the array.
|
| int number_of_descriptors() {
|
| - ASSERT(MayContainTransitions() || IsEmpty());
|
| + ASSERT(length() >= kFirstIndex || IsEmpty());
|
| int len = length();
|
| return len <= kFirstIndex ? 0 : (len - kFirstIndex) / kDescriptorSize;
|
| }
|
| @@ -2507,13 +2502,6 @@ class DescriptorArray: public FixedArray {
|
| kEnumCacheOffset);
|
| }
|
|
|
| - Object** GetTransitionsSlot() {
|
| - return HeapObject::RawField(reinterpret_cast<HeapObject*>(this),
|
| - kTransitionsOffset);
|
| - }
|
| -
|
| - DECL_ACCESSORS(back_pointer_storage, Object)
|
| -
|
| // Initialize or change the enum cache,
|
| // using the supplied storage for the small "bridge".
|
| void SetEnumCache(FixedArray* bridge_storage,
|
| @@ -2551,17 +2539,6 @@ class DescriptorArray: public FixedArray {
|
| int src_index,
|
| const WhitenessWitness&);
|
|
|
| - // Indicates whether the search function should expect a sorted or an unsorted
|
| - // descriptor array as input.
|
| - enum SharedMode {
|
| - MAY_BE_SHARED,
|
| - CANNOT_BE_SHARED
|
| - };
|
| -
|
| - // Return a copy of the array with all transitions and null descriptors
|
| - // removed. Return a Failure object in case of an allocation failure.
|
| - MUST_USE_RESULT MaybeObject* Copy(SharedMode shared_mode);
|
| -
|
| // Sort the instance descriptors by the hash codes of their keys.
|
| void Sort(const WhitenessWitness&);
|
|
|
| @@ -2577,8 +2554,7 @@ class DescriptorArray: public FixedArray {
|
|
|
| // Allocates a DescriptorArray, but returns the singleton
|
| // empty descriptor array object if number_of_descriptors is 0.
|
| - MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors,
|
| - SharedMode shared_mode);
|
| + MUST_USE_RESULT static MaybeObject* Allocate(int number_of_descriptors);
|
|
|
| // Casting.
|
| static inline DescriptorArray* cast(Object* obj);
|
| @@ -2586,10 +2562,8 @@ class DescriptorArray: public FixedArray {
|
| // Constant for denoting key was not found.
|
| static const int kNotFound = -1;
|
|
|
| - static const int kBackPointerStorageIndex = 0;
|
| - static const int kEnumCacheIndex = 1;
|
| - static const int kTransitionsIndex = 2;
|
| - static const int kFirstIndex = 3;
|
| + static const int kEnumCacheIndex = 0;
|
| + static const int kFirstIndex = 1;
|
|
|
| // The length of the "bridge" to the enum cache.
|
| static const int kEnumCacheBridgeLength = 2;
|
| @@ -2597,11 +2571,8 @@ class DescriptorArray: public FixedArray {
|
| static const int kEnumCacheBridgeIndicesCacheIndex = 1;
|
|
|
| // Layout description.
|
| - static const int kBackPointerStorageOffset = FixedArray::kHeaderSize;
|
| - static const int kEnumCacheOffset = kBackPointerStorageOffset +
|
| - kPointerSize;
|
| - static const int kTransitionsOffset = kEnumCacheOffset + kPointerSize;
|
| - static const int kFirstOffset = kTransitionsOffset + kPointerSize;
|
| + static const int kEnumCacheOffset = FixedArray::kHeaderSize;
|
| + static const int kFirstOffset = kEnumCacheOffset + kPointerSize;
|
|
|
| // Layout description for the bridge array.
|
| static const int kEnumCacheBridgeCacheOffset = FixedArray::kHeaderSize;
|
| @@ -4798,11 +4769,9 @@ class Map: public HeapObject {
|
| inline Map* elements_transition_map();
|
| MUST_USE_RESULT inline MaybeObject* set_elements_transition_map(
|
| Map* transitioned_map);
|
| - inline TransitionArray* transitions();
|
| inline void SetTransition(int index, Map* target);
|
| MUST_USE_RESULT inline MaybeObject* AddTransition(String* key, Map* target);
|
| - MUST_USE_RESULT inline MaybeObject* set_transitions(
|
| - TransitionArray* transitions);
|
| + DECL_ACCESSORS(transitions, TransitionArray)
|
| inline void ClearTransitions(Heap* heap,
|
| WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
|
|
|
| @@ -4832,12 +4801,14 @@ class Map: public HeapObject {
|
| inline JSFunction* unchecked_constructor();
|
|
|
| // [instance descriptors]: describes the object.
|
| - DECL_ACCESSORS(instance_descriptors, DescriptorArray)
|
| - inline void InitializeDescriptors(DescriptorArray* descriptors);
|
| -
|
| - // Should only be called to clear a descriptor array that was only used to
|
| - // store transitions and does not contain any live transitions anymore.
|
| - inline void ClearDescriptorArray(Heap* heap, WriteBarrierMode mode);
|
| + inline DescriptorArray* instance_descriptors();
|
| + MUST_USE_RESULT inline MaybeObject* SetDescriptors(
|
| + DescriptorArray* descriptors,
|
| + WriteBarrierMode mode = UPDATE_WRITE_BARRIER);
|
| + static void SetDescriptors(Handle<Map> map,
|
| + Handle<DescriptorArray> descriptors);
|
| + MUST_USE_RESULT inline MaybeObject* InitializeDescriptors(
|
| + DescriptorArray* descriptors);
|
|
|
| // [stub cache]: contains stubs compiled for this map.
|
| DECL_ACCESSORS(code_cache, Object)
|
| @@ -4943,7 +4914,7 @@ class Map: public HeapObject {
|
|
|
| // Returns a copy of the map, with all transitions dropped from the
|
| // instance descriptors.
|
| - MUST_USE_RESULT MaybeObject* Copy(DescriptorArray::SharedMode shared_mode);
|
| + MUST_USE_RESULT MaybeObject* Copy();
|
|
|
| // Returns the property index for name (only valid for FAST MODE).
|
| int PropertyIndexFor(String* name);
|
| @@ -5069,10 +5040,10 @@ class Map: public HeapObject {
|
| // map flags when unused (bit_field3). When the map has instance descriptors,
|
| // the flags are transferred to the instance descriptor array and accessed
|
| // through an extra indirection.
|
| - static const int kInstanceDescriptorsOrBackPointerOffset =
|
| + static const int kTransitionsOrBackPointerOffset =
|
| kConstructorOffset + kPointerSize;
|
| static const int kCodeCacheOffset =
|
| - kInstanceDescriptorsOrBackPointerOffset + kPointerSize;
|
| + kTransitionsOrBackPointerOffset + kPointerSize;
|
| static const int kBitField3Offset = kCodeCacheOffset + kPointerSize;
|
| static const int kPadStart = kBitField3Offset + kPointerSize;
|
| static const int kSize = MAP_POINTER_ALIGN(kPadStart);
|
|
|