OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium 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 TraceTraits_h | 5 #ifndef TraceTraits_h |
6 #define TraceTraits_h | 6 #define TraceTraits_h |
7 | 7 |
8 #include "platform/heap/GCInfo.h" | 8 #include "platform/heap/GCInfo.h" |
9 #include "platform/heap/Heap.h" | 9 #include "platform/heap/Heap.h" |
10 #include "platform/heap/Visitor.h" | 10 #include "platform/heap/Visitor.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 // unbounded system stack usage they can bring about. | 49 // unbounded system stack usage they can bring about. |
50 // | 50 // |
51 // Assert against deep stacks so as to flush them out, | 51 // Assert against deep stacks so as to flush them out, |
52 // but test and appropriately handle them should they occur | 52 // but test and appropriately handle them should they occur |
53 // in release builds. | 53 // in release builds. |
54 // | 54 // |
55 // ASan adds extra stack usage, so disable the assert when it is | 55 // ASan adds extra stack usage, so disable the assert when it is |
56 // enabled so as to avoid testing against a much lower & too low, | 56 // enabled so as to avoid testing against a much lower & too low, |
57 // stack depth threshold. | 57 // stack depth threshold. |
58 #if !defined(ADDRESS_SANITIZER) | 58 #if !defined(ADDRESS_SANITIZER) |
59 ASSERT(StackFrameDepth::isSafeToRecurse()); | 59 ASSERT(!StackFrameDepth::isEnabled() || StackFrameDepth::isSafeToRec
urse()); |
60 #endif | 60 #endif |
61 if (LIKELY(StackFrameDepth::isSafeToRecurse())) { | 61 if (LIKELY(StackFrameDepth::isSafeToRecurse())) { |
62 if (visitor->ensureMarked(t)) { | 62 if (visitor->ensureMarked(t)) { |
63 TraceTrait<T>::trace(visitor, const_cast<T*>(t)); | 63 TraceTrait<T>::trace(visitor, const_cast<T*>(t)); |
64 } | 64 } |
65 return; | 65 return; |
66 } | 66 } |
67 } | 67 } |
68 visitor->mark(const_cast<T*>(t), &TraceTrait<T>::trace); | 68 visitor->mark(const_cast<T*>(t), &TraceTrait<T>::trace); |
69 } | 69 } |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 // since iterating over the hash table backing will find the whole | 549 // since iterating over the hash table backing will find the whole |
550 // chain. | 550 // chain. |
551 visitor->markNoTracing(node); | 551 visitor->markNoTracing(node); |
552 return false; | 552 return false; |
553 } | 553 } |
554 }; | 554 }; |
555 | 555 |
556 } // namespace WTF | 556 } // namespace WTF |
557 | 557 |
558 #endif | 558 #endif |
OLD | NEW |