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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 static inline bool IsSimpleTransition(Object* raw_transition) { | 62 static inline bool IsSimpleTransition(Object* raw_transition) { |
63 DCHECK(!raw_transition->IsWeakCell() || | 63 DCHECK(!raw_transition->IsWeakCell() || |
64 WeakCell::cast(raw_transition)->cleared() || | 64 WeakCell::cast(raw_transition)->cleared() || |
65 WeakCell::cast(raw_transition)->value()->IsMap()); | 65 WeakCell::cast(raw_transition)->value()->IsMap()); |
66 return raw_transition->IsWeakCell() && | 66 return raw_transition->IsWeakCell() && |
67 !WeakCell::cast(raw_transition)->cleared(); | 67 !WeakCell::cast(raw_transition)->cleared(); |
68 } | 68 } |
69 static inline Map* GetSimpleTransition(Object* raw_transition) { | 69 static inline Map* GetSimpleTransition(Object* raw_transition) { |
70 DCHECK(IsSimpleTransition(raw_transition)); | 70 DCHECK(IsSimpleTransition(raw_transition)); |
| 71 DCHECK(raw_transition->IsWeakCell()); |
71 return Map::cast(WeakCell::cast(raw_transition)->value()); | 72 return Map::cast(WeakCell::cast(raw_transition)->value()); |
72 } | 73 } |
73 static inline bool IsFullTransitionArray(Object* raw_transitions) { | 74 static inline bool IsFullTransitionArray(Object* raw_transitions) { |
74 return raw_transitions->IsTransitionArray(); | 75 return raw_transitions->IsTransitionArray(); |
75 } | 76 } |
76 | 77 |
77 // The size of transition arrays are limited so they do not end up in large | 78 // The size of transition arrays are limited so they do not end up in large |
78 // object space. Otherwise ClearNonLiveReferences would leak memory while | 79 // object space. Otherwise ClearNonLiveReferences would leak memory while |
79 // applying in-place right trimming. | 80 // applying in-place right trimming. |
80 static bool CanHaveMoreTransitions(Handle<Map> map); | 81 static bool CanHaveMoreTransitions(Handle<Map> map); |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 Object* transitions); | 299 Object* transitions); |
299 #endif | 300 #endif |
300 | 301 |
301 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); | 302 DISALLOW_IMPLICIT_CONSTRUCTORS(TransitionArray); |
302 }; | 303 }; |
303 | 304 |
304 | 305 |
305 } } // namespace v8::internal | 306 } } // namespace v8::internal |
306 | 307 |
307 #endif // V8_TRANSITIONS_H_ | 308 #endif // V8_TRANSITIONS_H_ |
OLD | NEW |