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

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

Issue 2684633004: Remove orphaned pages from Oilpan (Closed)
Patch Set: temp Created 3 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/StackFrameDepth.h" 10 #include "platform/heap/StackFrameDepth.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 101
102 template <typename T> 102 template <typename T>
103 class AdjustAndMarkTrait<T, true> { 103 class AdjustAndMarkTrait<T, true> {
104 STATIC_ONLY(AdjustAndMarkTrait); 104 STATIC_ONLY(AdjustAndMarkTrait);
105 105
106 public: 106 public:
107 template <typename VisitorDispatcher> 107 template <typename VisitorDispatcher>
108 static void mark(VisitorDispatcher visitor, const T* self) { 108 static void mark(VisitorDispatcher visitor, const T* self) {
109 if (!self) 109 if (!self)
110 return; 110 return;
111
112 // If you hit this ASSERT, it means that there is a dangling pointer
113 // from a live thread heap to a dead thread heap. We must eliminate
114 // the dangling pointer.
115 // Release builds don't have the ASSERT, but it is OK because
116 // release builds will crash at the following self->adjustAndMark
117 // because all the entries of the orphaned arenas are zeroed out and
118 // thus the item does not have a valid vtable.
119 ASSERT(!pageFromObject(self)->orphaned());
120 self->adjustAndMark(visitor); 111 self->adjustAndMark(visitor);
121 } 112 }
122 }; 113 };
123 114
124 template <typename T, bool isTraceable> 115 template <typename T, bool isTraceable>
125 struct TraceIfEnabled; 116 struct TraceIfEnabled;
126 117
127 template <typename T> 118 template <typename T>
128 struct TraceIfEnabled<T, false> { 119 struct TraceIfEnabled<T, false> {
129 STATIC_ONLY(TraceIfEnabled); 120 STATIC_ONLY(TraceIfEnabled);
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 // since iterating over the hash table backing will find the whole 784 // since iterating over the hash table backing will find the whole
794 // chain. 785 // chain.
795 visitor->markNoTracing(node); 786 visitor->markNoTracing(node);
796 return false; 787 return false;
797 } 788 }
798 }; 789 };
799 790
800 } // namespace WTF 791 } // namespace WTF
801 792
802 #endif 793 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.cpp ('k') | third_party/WebKit/Source/platform/heap/VisitorImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698