OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_TRANSITIONS_H_ | 5 #ifndef V8_TRANSITIONS_H_ |
6 #define V8_TRANSITIONS_H_ | 6 #define V8_TRANSITIONS_H_ |
7 | 7 |
8 #include "src/checks.h" | 8 #include "src/checks.h" |
9 #include "src/elements-kind.h" | 9 #include "src/elements-kind.h" |
10 #include "src/heap/heap.h" | 10 #include "src/heap/heap.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 static const int kPrototypeTransitionsOffset = kBackPointerStorageOffset + | 148 static const int kPrototypeTransitionsOffset = kBackPointerStorageOffset + |
149 kPointerSize; | 149 kPointerSize; |
150 static const int kTransitionLengthOffset = | 150 static const int kTransitionLengthOffset = |
151 kPrototypeTransitionsOffset + kPointerSize; | 151 kPrototypeTransitionsOffset + kPointerSize; |
152 | 152 |
153 // Layout of map transition entries in full transition arrays. | 153 // Layout of map transition entries in full transition arrays. |
154 static const int kTransitionKey = 0; | 154 static const int kTransitionKey = 0; |
155 static const int kTransitionTarget = 1; | 155 static const int kTransitionTarget = 1; |
156 static const int kTransitionSize = 2; | 156 static const int kTransitionSize = 2; |
157 | 157 |
158 #ifdef OBJECT_PRINT | 158 #ifdef DEBUG |
159 // For our gdb macros, we should perhaps change these in the future. | 159 // For our gdb macros, we should perhaps change these in the future. |
160 void Print(); | 160 void Print(); |
161 | 161 |
162 // Print all the transitions. | 162 // Print all the transitions. |
163 void PrintTransitions(std::ostream& os, bool print_header = true); // NOLINT | 163 void PrintTransitions(std::ostream& os, bool print_header = true); // NOLINT |
164 #endif | |
165 | 164 |
166 #ifdef DEBUG | |
167 bool IsSortedNoDuplicates(int valid_entries = -1); | 165 bool IsSortedNoDuplicates(int valid_entries = -1); |
168 bool IsConsistentWithBackPointers(Map* current_map); | 166 bool IsConsistentWithBackPointers(Map* current_map); |
169 bool IsEqualTo(TransitionArray* other); | 167 bool IsEqualTo(TransitionArray* other); |
170 #endif | 168 #endif |
171 | 169 |
172 // The maximum number of transitions we want in a transition array (should | 170 // The maximum number of transitions we want in a transition array (should |
173 // fit in a page). | 171 // fit in a page). |
174 static const int kMaxNumberOfTransitions = 1024 + 512; | 172 static const int kMaxNumberOfTransitions = 1024 + 512; |
175 | 173 |
176 // Returns the fixed array length required to hold number_of_transitions | 174 // Returns the fixed array length required to hold number_of_transitions |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 int origin_transition, | 209 int origin_transition, |
212 int target_transition); | 210 int target_transition); |
213 | 211 |
214 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); | 212 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); |
215 }; | 213 }; |
216 | 214 |
217 | 215 |
218 } } // namespace v8::internal | 216 } } // namespace v8::internal |
219 | 217 |
220 #endif // V8_TRANSITIONS_H_ | 218 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |