OLD | NEW |
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 HeapAllocator_h | 5 #ifndef HeapAllocator_h |
6 #define HeapAllocator_h | 6 #define HeapAllocator_h |
7 | 7 |
8 #include "platform/heap/Heap.h" | 8 #include "platform/heap/Heap.h" |
9 #include "platform/heap/Persistent.h" | 9 #include "platform/heap/Persistent.h" |
10 #include "platform/heap/TraceTraits.h" | 10 #include "platform/heap/TraceTraits.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 template <typename T> | 142 template <typename T> |
143 static void* NewArray(size_t bytes) { | 143 static void* NewArray(size_t bytes) { |
144 ASSERT_NOT_REACHED(); | 144 ASSERT_NOT_REACHED(); |
145 return 0; | 145 return 0; |
146 } | 146 } |
147 | 147 |
148 static void DeleteArray(void* ptr) { ASSERT_NOT_REACHED(); } | 148 static void DeleteArray(void* ptr) { ASSERT_NOT_REACHED(); } |
149 | 149 |
150 static bool IsAllocationAllowed() { | 150 static bool IsAllocationAllowed() { |
151 return ThreadState::Current()->IsAllocationAllowed(); | 151 return ThreadState::Current()->IsAllocationAllowed() && |
| 152 !ThreadState::Current()->IsObjectResurrectionForbidden(); |
| 153 } |
| 154 |
| 155 static bool IsObjectResurrectionForbidden() { |
| 156 return ThreadState::Current()->IsObjectResurrectionForbidden(); |
152 } | 157 } |
153 | 158 |
154 template <typename T> | 159 template <typename T> |
155 static bool IsHeapObjectAlive(T* object) { | 160 static bool IsHeapObjectAlive(T* object) { |
156 return ThreadHeap::IsHeapObjectAlive(object); | 161 return ThreadHeap::IsHeapObjectAlive(object); |
157 } | 162 } |
158 | 163 |
159 template <typename VisitorDispatcher> | 164 template <typename VisitorDispatcher> |
160 static void MarkNoTracing(VisitorDispatcher visitor, const void* t) { | 165 static void MarkNoTracing(VisitorDispatcher visitor, const void* t) { |
161 visitor->MarkNoTracing(t); | 166 visitor->MarkNoTracing(t); |
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
842 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, | 847 const blink::HeapHashCountedSet<Value, HashFunctions, Traits>& set, |
843 VectorType& vector) { | 848 VectorType& vector) { |
844 CopyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, | 849 CopyToVector(static_cast<const HashCountedSet<Value, HashFunctions, Traits, |
845 blink::HeapAllocator>&>(set), | 850 blink::HeapAllocator>&>(set), |
846 vector); | 851 vector); |
847 } | 852 } |
848 | 853 |
849 } // namespace WTF | 854 } // namespace WTF |
850 | 855 |
851 #endif | 856 #endif |
OLD | NEW |