| 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: |
| 196 virtual ~PersistentAnchor() | 197 virtual ~PersistentAnchor() |
| 197 { | 198 { |
| 198 // FIXME: oilpan: Ideally we should have no left-over persistents at thi
s point. However currently there is a | 199 // FIXME: oilpan: Ideally we should have no left-over persistents at thi
s point. However currently there is a |
| 199 // large number of objects leaked when we tear down the main thread. Sin
ce some of these might contain a | 200 // large number of objects leaked when we tear down the main thread. Sin
ce some of these might contain a |
| 200 // persistent or e.g. be RefCountedGarbageCollected we cannot guarantee
there are no remaining Persistents at | 201 // persistent or e.g. be RefCountedGarbageCollected we cannot guarantee
there are no remaining Persistents at |
| 201 // this point. | 202 // this point. |
| 202 } | 203 } |
| 203 | |
| 204 private: | |
| 205 PersistentAnchor() : PersistentNode(TraceMethodDelegate<PersistentAnchor, &P
ersistentAnchor::trace>::trampoline) | 204 PersistentAnchor() : PersistentNode(TraceMethodDelegate<PersistentAnchor, &P
ersistentAnchor::trace>::trampoline) |
| 206 { | 205 { |
| 207 m_next = this; | 206 m_next = this; |
| 208 m_prev = this; | 207 m_prev = this; |
| 209 } | 208 } |
| 210 | 209 |
| 211 friend class ThreadState; | 210 friend class ThreadState; |
| 212 }; | 211 }; |
| 213 | 212 |
| 214 // Persistent handles are used to store pointers into the | 213 // Persistent handles are used to store pointers into the |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 }; | 839 }; |
| 841 | 840 |
| 842 template<typename T, typename U> | 841 template<typename T, typename U> |
| 843 struct NeedsTracing<HashMap<T, U> > { | 842 struct NeedsTracing<HashMap<T, U> > { |
| 844 static const bool value = false; | 843 static const bool value = false; |
| 845 }; | 844 }; |
| 846 | 845 |
| 847 } // namespace WTF | 846 } // namespace WTF |
| 848 | 847 |
| 849 #endif | 848 #endif |
| OLD | NEW |