| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef Heap_h | 31 #ifndef Heap_h |
| 32 #define Heap_h | 32 #define Heap_h |
| 33 | 33 |
| 34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/heap/GCInfo.h" | 35 #include "platform/heap/GCInfo.h" |
| 36 #include "platform/heap/HeapPage.h" | 36 #include "platform/heap/HeapPage.h" |
| 37 #include "platform/heap/PageMemory.h" | 37 #include "platform/heap/PageMemory.h" |
| 38 #include "platform/heap/StackFrameDepth.h" | |
| 39 #include "platform/heap/ThreadState.h" | 38 #include "platform/heap/ThreadState.h" |
| 40 #include "platform/heap/Visitor.h" | 39 #include "platform/heap/Visitor.h" |
| 41 #include "wtf/AddressSanitizer.h" | 40 #include "wtf/AddressSanitizer.h" |
| 42 #include "wtf/Allocator.h" | 41 #include "wtf/Allocator.h" |
| 43 #include "wtf/Assertions.h" | 42 #include "wtf/Assertions.h" |
| 44 #include "wtf/Atomics.h" | 43 #include "wtf/Atomics.h" |
| 45 #include "wtf/Forward.h" | 44 #include "wtf/Forward.h" |
| 46 #include <memory> | 45 #include <memory> |
| 47 | 46 |
| 48 namespace blink { | 47 namespace blink { |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 static inline bool isHeapObjectAlive(const UntracedMember<T>& member) | 224 static inline bool isHeapObjectAlive(const UntracedMember<T>& member) |
| 226 { | 225 { |
| 227 return isHeapObjectAlive(member.get()); | 226 return isHeapObjectAlive(member.get()); |
| 228 } | 227 } |
| 229 template<typename T> | 228 template<typename T> |
| 230 static inline bool isHeapObjectAlive(const T*& ptr) | 229 static inline bool isHeapObjectAlive(const T*& ptr) |
| 231 { | 230 { |
| 232 return isHeapObjectAlive(ptr); | 231 return isHeapObjectAlive(ptr); |
| 233 } | 232 } |
| 234 | 233 |
| 235 StackFrameDepth& stackFrameDepth() { return m_stackFrameDepth; } | |
| 236 | |
| 237 RecursiveMutex& threadAttachMutex() { return m_threadAttachMutex; } | 234 RecursiveMutex& threadAttachMutex() { return m_threadAttachMutex; } |
| 238 const ThreadStateSet& threads() const { return m_threads; } | 235 const ThreadStateSet& threads() const { return m_threads; } |
| 239 ThreadHeapStats& heapStats() { return m_stats; } | 236 ThreadHeapStats& heapStats() { return m_stats; } |
| 240 SafePointBarrier* safePointBarrier() { return m_safePointBarrier.get(); } | 237 SafePointBarrier* safePointBarrier() { return m_safePointBarrier.get(); } |
| 241 CallbackStack* markingStack() const { return m_markingStack.get(); } | 238 CallbackStack* markingStack() const { return m_markingStack.get(); } |
| 242 CallbackStack* postMarkingCallbackStack() const { return m_postMarkingCallba
ckStack.get(); } | 239 CallbackStack* postMarkingCallbackStack() const { return m_postMarkingCallba
ckStack.get(); } |
| 243 CallbackStack* globalWeakCallbackStack() const { return m_globalWeakCallback
Stack.get(); } | 240 CallbackStack* globalWeakCallbackStack() const { return m_globalWeakCallback
Stack.get(); } |
| 244 CallbackStack* ephemeronStack() const { return m_ephemeronStack.get(); } | 241 CallbackStack* ephemeronStack() const { return m_ephemeronStack.get(); } |
| 245 | 242 |
| 246 void attach(ThreadState*); | 243 void attach(ThreadState*); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 std::unique_ptr<RegionTree> m_regionTree; | 405 std::unique_ptr<RegionTree> m_regionTree; |
| 409 std::unique_ptr<HeapDoesNotContainCache> m_heapDoesNotContainCache; | 406 std::unique_ptr<HeapDoesNotContainCache> m_heapDoesNotContainCache; |
| 410 std::unique_ptr<SafePointBarrier> m_safePointBarrier; | 407 std::unique_ptr<SafePointBarrier> m_safePointBarrier; |
| 411 std::unique_ptr<FreePagePool> m_freePagePool; | 408 std::unique_ptr<FreePagePool> m_freePagePool; |
| 412 std::unique_ptr<OrphanedPagePool> m_orphanedPagePool; | 409 std::unique_ptr<OrphanedPagePool> m_orphanedPagePool; |
| 413 std::unique_ptr<CallbackStack> m_markingStack; | 410 std::unique_ptr<CallbackStack> m_markingStack; |
| 414 std::unique_ptr<CallbackStack> m_postMarkingCallbackStack; | 411 std::unique_ptr<CallbackStack> m_postMarkingCallbackStack; |
| 415 std::unique_ptr<CallbackStack> m_globalWeakCallbackStack; | 412 std::unique_ptr<CallbackStack> m_globalWeakCallbackStack; |
| 416 std::unique_ptr<CallbackStack> m_ephemeronStack; | 413 std::unique_ptr<CallbackStack> m_ephemeronStack; |
| 417 BlinkGC::GCReason m_lastGCReason; | 414 BlinkGC::GCReason m_lastGCReason; |
| 418 StackFrameDepth m_stackFrameDepth; | |
| 419 | 415 |
| 420 static ThreadHeap* s_mainThreadHeap; | 416 static ThreadHeap* s_mainThreadHeap; |
| 421 | 417 |
| 422 friend class ThreadState; | 418 friend class ThreadState; |
| 423 }; | 419 }; |
| 424 | 420 |
| 425 template<typename T> | 421 template<typename T> |
| 426 struct IsEagerlyFinalizedType { | 422 struct IsEagerlyFinalizedType { |
| 427 STATIC_ONLY(IsEagerlyFinalizedType); | 423 STATIC_ONLY(IsEagerlyFinalizedType); |
| 428 private: | 424 private: |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) | 620 void VisitorHelper<Derived>::handleWeakCell(Visitor* self, void* object) |
| 625 { | 621 { |
| 626 T** cell = reinterpret_cast<T**>(object); | 622 T** cell = reinterpret_cast<T**>(object); |
| 627 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 623 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 628 *cell = nullptr; | 624 *cell = nullptr; |
| 629 } | 625 } |
| 630 | 626 |
| 631 } // namespace blink | 627 } // namespace blink |
| 632 | 628 |
| 633 #endif // Heap_h | 629 #endif // Heap_h |
| OLD | NEW |