OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 inline PropertyDetails GetTargetDetails(int transition_number); | 57 inline PropertyDetails GetTargetDetails(int transition_number); |
58 | 58 |
59 inline Map* elements_transition(); | 59 inline Map* elements_transition(); |
60 inline void set_elements_transition( | 60 inline void set_elements_transition( |
61 Map* target, | 61 Map* target, |
62 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 62 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
63 inline bool HasElementsTransition(); | 63 inline bool HasElementsTransition(); |
64 inline void ClearElementsTransition(); | 64 inline void ClearElementsTransition(); |
65 | 65 |
| 66 inline DescriptorArray* descriptors(); |
| 67 inline void set_descriptors(DescriptorArray* descriptors, |
| 68 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 69 inline Object** GetDescriptorsSlot(); |
| 70 |
| 71 inline Object* back_pointer_storage(); |
| 72 inline void set_back_pointer_storage( |
| 73 Object* back_pointer, |
| 74 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
| 75 |
66 inline FixedArray* GetPrototypeTransitions(); | 76 inline FixedArray* GetPrototypeTransitions(); |
67 inline void SetPrototypeTransitions( | 77 inline void SetPrototypeTransitions( |
68 FixedArray* prototype_transitions, | 78 FixedArray* prototype_transitions, |
69 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); | 79 WriteBarrierMode mode = UPDATE_WRITE_BARRIER); |
70 inline Object** GetPrototypeTransitionsSlot(); | 80 inline Object** GetPrototypeTransitionsSlot(); |
71 inline bool HasPrototypeTransitions(); | 81 inline bool HasPrototypeTransitions(); |
72 inline HeapObject* UncheckedPrototypeTransitions(); | 82 inline HeapObject* UncheckedPrototypeTransitions(); |
73 | 83 |
74 // Returns the number of transitions in the array. | 84 // Returns the number of transitions in the array. |
75 int number_of_transitions() { | 85 int number_of_transitions() { |
(...skipping 23 matching lines...) Expand all Loading... |
99 | 109 |
100 // Allocates a TransitionArray. | 110 // Allocates a TransitionArray. |
101 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_transitions); | 111 MUST_USE_RESULT static MaybeObject* Allocate(int number_of_transitions); |
102 | 112 |
103 // Casting. | 113 // Casting. |
104 static inline TransitionArray* cast(Object* obj); | 114 static inline TransitionArray* cast(Object* obj); |
105 | 115 |
106 // Constant for denoting key was not found. | 116 // Constant for denoting key was not found. |
107 static const int kNotFound = -1; | 117 static const int kNotFound = -1; |
108 | 118 |
109 static const int kElementsTransitionIndex = 0; | 119 static const int kDescriptorsIndex = 0; |
110 static const int kPrototypeTransitionsIndex = 1; | 120 static const int kBackPointerStorageIndex = 1; |
111 static const int kFirstIndex = 2; | 121 static const int kElementsTransitionIndex = 2; |
| 122 static const int kPrototypeTransitionsIndex = 3; |
| 123 static const int kFirstIndex = 4; |
112 | 124 |
113 // Layout transition array header. | 125 // Layout transition array header. |
114 static const int kElementsTransitionOffset = FixedArray::kHeaderSize; | 126 static const int kDescriptorsOffset = FixedArray::kHeaderSize; |
| 127 static const int kBackPointerStorageOffset = kDescriptorsOffset + |
| 128 kPointerSize; |
| 129 static const int kElementsTransitionOffset = kBackPointerStorageOffset + |
| 130 kPointerSize; |
115 static const int kPrototypeTransitionsOffset = kElementsTransitionOffset + | 131 static const int kPrototypeTransitionsOffset = kElementsTransitionOffset + |
116 kPointerSize; | 132 kPointerSize; |
117 static const int kFirstOffset = kPrototypeTransitionsOffset + kPointerSize; | |
118 | 133 |
119 // Layout of map transition. | 134 // Layout of map transition. |
120 static const int kTransitionKey = 0; | 135 static const int kTransitionKey = 0; |
121 static const int kTransitionTarget = 1; | 136 static const int kTransitionTarget = 1; |
122 static const int kTransitionSize = 2; | 137 static const int kTransitionSize = 2; |
123 | 138 |
124 #ifdef OBJECT_PRINT | 139 #ifdef OBJECT_PRINT |
125 // Print all the transitions. | 140 // Print all the transitions. |
126 inline void PrintTransitions() { | 141 inline void PrintTransitions() { |
127 PrintTransitions(stdout); | 142 PrintTransitions(stdout); |
(...skipping 30 matching lines...) Expand all Loading... |
158 Map* target, | 173 Map* target, |
159 const WhitenessWitness&); | 174 const WhitenessWitness&); |
160 | 175 |
161 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); | 176 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); |
162 }; | 177 }; |
163 | 178 |
164 | 179 |
165 } } // namespace v8::internal | 180 } } // namespace v8::internal |
166 | 181 |
167 #endif // V8_TRANSITIONS_H_ | 182 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |