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

Side by Side Diff: third_party/WebKit/Source/platform/heap/TraceTraits.h

Issue 1663823002: If marking system stack is unknown, be more forgiving about stack depths. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 10 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
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // If the trait allows it, invoke the trace callback right here on the 50 // If the trait allows it, invoke the trace callback right here on the
51 // not-yet-marked object. 51 // not-yet-marked object.
52 if (TraceEagerlyTrait<T>::value) { 52 if (TraceEagerlyTrait<T>::value) {
53 // Protect against too deep trace call chains, and the 53 // Protect against too deep trace call chains, and the
54 // unbounded system stack usage they can bring about. 54 // unbounded system stack usage they can bring about.
55 // 55 //
56 // Assert against deep stacks so as to flush them out, 56 // Assert against deep stacks so as to flush them out,
57 // but test and appropriately handle them should they occur 57 // but test and appropriately handle them should they occur
58 // in release builds. 58 // in release builds.
59 // 59 //
60 // ASan adds extra stack usage, so disable the assert when it is 60 ASSERT(StackFrameDepth::isAcceptableStackUse());
61 // enabled so as to avoid testing against a much lower & too low,
62 // stack depth threshold.
63 #if !defined(ADDRESS_SANITIZER)
64 ASSERT(!StackFrameDepth::isEnabled() || StackFrameDepth::isSafeToRec urse());
65 #endif
66 if (LIKELY(StackFrameDepth::isSafeToRecurse())) { 61 if (LIKELY(StackFrameDepth::isSafeToRecurse())) {
67 if (visitor->ensureMarked(t)) { 62 if (visitor->ensureMarked(t)) {
68 TraceTrait<T>::trace(visitor, const_cast<T*>(t)); 63 TraceTrait<T>::trace(visitor, const_cast<T*>(t));
69 } 64 }
70 return; 65 return;
71 } 66 }
72 } 67 }
73 visitor->mark(const_cast<T*>(t), &TraceTrait<T>::trace); 68 visitor->mark(const_cast<T*>(t), &TraceTrait<T>::trace);
74 } 69 }
75 }; 70 };
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 // since iterating over the hash table backing will find the whole 585 // since iterating over the hash table backing will find the whole
591 // chain. 586 // chain.
592 visitor->markNoTracing(node); 587 visitor->markNoTracing(node);
593 return false; 588 return false;
594 } 589 }
595 }; 590 };
596 591
597 } // namespace WTF 592 } // namespace WTF
598 593
599 #endif 594 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698