OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // A dummy Persistent handle that ensures the list of persistents is never null. | 186 // A dummy Persistent handle that ensures the list of persistents is never null. |
187 // This removes a test from a hot path. | 187 // This removes a test from a hot path. |
188 class PersistentAnchor : public PersistentNode { | 188 class PersistentAnchor : public PersistentNode { |
189 public: | 189 public: |
190 void trace(Visitor* visitor) | 190 void trace(Visitor* visitor) |
191 { | 191 { |
192 for (PersistentNode* current = m_next; current != this; current = curren
t->m_next) | 192 for (PersistentNode* current = m_next; current != this; current = curren
t->m_next) |
193 current->trace(visitor); | 193 current->trace(visitor); |
194 } | 194 } |
195 | 195 |
196 private: | |
197 virtual ~PersistentAnchor() | 196 virtual ~PersistentAnchor() |
198 { | 197 { |
199 // FIXME: oilpan: Ideally we should have no left-over persistents at thi
s point. However currently there is a | 198 // FIXME: oilpan: Ideally we should have no left-over persistents at thi
s point. However currently there is a |
200 // large number of objects leaked when we tear down the main thread. Sin
ce some of these might contain a | 199 // large number of objects leaked when we tear down the main thread. Sin
ce some of these might contain a |
201 // persistent or e.g. be RefCountedGarbageCollected we cannot guarantee
there are no remaining Persistents at | 200 // persistent or e.g. be RefCountedGarbageCollected we cannot guarantee
there are no remaining Persistents at |
202 // this point. | 201 // this point. |
203 } | 202 } |
| 203 |
| 204 private: |
204 PersistentAnchor() : PersistentNode(TraceMethodDelegate<PersistentAnchor, &P
ersistentAnchor::trace>::trampoline) | 205 PersistentAnchor() : PersistentNode(TraceMethodDelegate<PersistentAnchor, &P
ersistentAnchor::trace>::trampoline) |
205 { | 206 { |
206 m_next = this; | 207 m_next = this; |
207 m_prev = this; | 208 m_prev = this; |
208 } | 209 } |
209 | 210 |
210 friend class ThreadState; | 211 friend class ThreadState; |
211 }; | 212 }; |
212 | 213 |
213 // Persistent handles are used to store pointers into the | 214 // Persistent handles are used to store pointers into the |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 }; | 840 }; |
840 | 841 |
841 template<typename T, typename U> | 842 template<typename T, typename U> |
842 struct NeedsTracing<HashMap<T, U> > { | 843 struct NeedsTracing<HashMap<T, U> > { |
843 static const bool value = false; | 844 static const bool value = false; |
844 }; | 845 }; |
845 | 846 |
846 } // namespace WTF | 847 } // namespace WTF |
847 | 848 |
848 #endif | 849 #endif |
OLD | NEW |