Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: src/transitions.h

Issue 1009603003: Add debug checks to catch crashes with WeakCell::cast(). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/objects-inl.h ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/objects-inl.h ('k') | src/type-feedback-vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698