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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 template<typename T> class HeapTerminatedArray; | 49 template<typename T> class HeapTerminatedArray; |
50 | 50 |
51 class PersistentNode { | 51 class PersistentNode { |
52 public: | 52 public: |
53 explicit PersistentNode(TraceCallback trace) | 53 explicit PersistentNode(TraceCallback trace) |
54 : m_trace(trace) | 54 : m_trace(trace) |
55 { | 55 { |
56 } | 56 } |
57 | 57 |
| 58 NO_LAZY_SWEEP_SANITIZE_ADDRESS |
58 bool isHeapObjectAlive() { return m_trace; } | 59 bool isHeapObjectAlive() { return m_trace; } |
59 | 60 |
60 virtual ~PersistentNode() | 61 virtual ~PersistentNode() |
61 { | 62 { |
62 ASSERT(isHeapObjectAlive()); | 63 ASSERT(isHeapObjectAlive()); |
63 m_trace = nullptr; | 64 m_trace = nullptr; |
64 } | 65 } |
65 | 66 |
66 // Ideally the trace method should be virtual and automatically dispatch | 67 // Ideally the trace method should be virtual and automatically dispatch |
67 // to the most specific implementation. However having a virtual method | 68 // to the most specific implementation. However having a virtual method |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 MutexLocker m_locker; | 120 MutexLocker m_locker; |
120 }; | 121 }; |
121 }; | 122 }; |
122 | 123 |
123 // Base class for persistent handles. RootsAccessor specifies which list to | 124 // Base class for persistent handles. RootsAccessor specifies which list to |
124 // link resulting handle into. Owner specifies the class containing trace | 125 // link resulting handle into. Owner specifies the class containing trace |
125 // method. | 126 // method. |
126 template<typename RootsAccessor, typename Owner> | 127 template<typename RootsAccessor, typename Owner> |
127 class PersistentBase : public PersistentNode { | 128 class PersistentBase : public PersistentNode { |
128 public: | 129 public: |
| 130 NO_LAZY_SWEEP_SANITIZE_ADDRESS |
129 ~PersistentBase() | 131 ~PersistentBase() |
130 { | 132 { |
131 typename RootsAccessor::Lock lock; | 133 typename RootsAccessor::Lock lock; |
132 ASSERT(m_roots == RootsAccessor::roots()); // Check that the thread is u
sing the same roots list. | 134 ASSERT(m_roots == RootsAccessor::roots()); // Check that the thread is u
sing the same roots list. |
133 ASSERT(isHeapObjectAlive()); | 135 ASSERT(isHeapObjectAlive()); |
134 ASSERT(m_next->isHeapObjectAlive()); | 136 ASSERT(m_next->isHeapObjectAlive()); |
135 ASSERT(m_prev->isHeapObjectAlive()); | 137 ASSERT(m_prev->isHeapObjectAlive()); |
136 m_next->m_prev = m_prev; | 138 m_next->m_prev = m_prev; |
137 m_prev->m_next = m_next; | 139 m_prev->m_next = m_next; |
138 } | 140 } |
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { | 1069 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin
k::IsGarbageCollectedType<T>::value> { |
1068 static_assert(sizeof(T), "T must be fully defined"); | 1070 static_assert(sizeof(T), "T must be fully defined"); |
1069 }; | 1071 }; |
1070 | 1072 |
1071 template<typename T> | 1073 template<typename T> |
1072 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 1074 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
1073 | 1075 |
1074 } // namespace WTF | 1076 } // namespace WTF |
1075 | 1077 |
1076 #endif | 1078 #endif |
OLD | NEW |