Chromium Code Reviews| 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/InlinedGlobalMarkingVisitor.h" | 10 #include "platform/heap/InlinedGlobalMarkingVisitor.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 // If the trait allows it, invoke the trace callback right here on the | 63 // If the trait allows it, invoke the trace callback right here on the |
| 64 // not-yet-marked object. | 64 // not-yet-marked object. |
| 65 if (TraceEagerlyTrait<T>::value) { | 65 if (TraceEagerlyTrait<T>::value) { |
| 66 // Protect against too deep trace call chains, and the | 66 // Protect against too deep trace call chains, and the |
| 67 // unbounded system stack usage they can bring about. | 67 // unbounded system stack usage they can bring about. |
| 68 // | 68 // |
| 69 // Assert against deep stacks so as to flush them out, | 69 // Assert against deep stacks so as to flush them out, |
| 70 // but test and appropriately handle them should they occur | 70 // but test and appropriately handle them should they occur |
| 71 // in release builds. | 71 // in release builds. |
| 72 // | 72 // |
| 73 ASSERT(StackFrameDepth::isAcceptableStackUse()); | 73 DCHECK(visitor->heap().stackFrameDepth().isAcceptableStackUse()); |
| 74 if (LIKELY(StackFrameDepth::isSafeToRecurse())) { | 74 if (LIKELY(visitor->heap().stackFrameDepth().isSafeToRecurse())) { |
|
haraken
2016/09/02 09:07:57
I hope this won't regress performance.
Moving Sta
| |
| 75 if (visitor->ensureMarked(t)) { | 75 if (visitor->ensureMarked(t)) { |
| 76 TraceTrait<T>::trace(visitor, const_cast<T*>(t)); | 76 TraceTrait<T>::trace(visitor, const_cast<T*>(t)); |
| 77 } | 77 } |
| 78 return; | 78 return; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 visitor->mark(const_cast<T*>(t), &TraceTrait<T>::trace); | 81 visitor->mark(const_cast<T*>(t), &TraceTrait<T>::trace); |
| 82 } | 82 } |
| 83 }; | 83 }; |
| 84 | 84 |
| (...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 607 // since iterating over the hash table backing will find the whole | 607 // since iterating over the hash table backing will find the whole |
| 608 // chain. | 608 // chain. |
| 609 visitor->markNoTracing(node); | 609 visitor->markNoTracing(node); |
| 610 return false; | 610 return false; |
| 611 } | 611 } |
| 612 }; | 612 }; |
| 613 | 613 |
| 614 } // namespace WTF | 614 } // namespace WTF |
| 615 | 615 |
| 616 #endif | 616 #endif |
| OLD | NEW |