| 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 29 matching lines...) Expand all Loading... |
| 40 #include "platform/heap/Visitor.h" | 40 #include "platform/heap/Visitor.h" |
| 41 #include "wtf/AddressSanitizer.h" | 41 #include "wtf/AddressSanitizer.h" |
| 42 #include "wtf/Allocator.h" | 42 #include "wtf/Allocator.h" |
| 43 #include "wtf/Assertions.h" | 43 #include "wtf/Assertions.h" |
| 44 #include "wtf/Atomics.h" | 44 #include "wtf/Atomics.h" |
| 45 #include "wtf/Forward.h" | 45 #include "wtf/Forward.h" |
| 46 #include <memory> | 46 #include <memory> |
| 47 | 47 |
| 48 namespace blink { | 48 namespace blink { |
| 49 | 49 |
| 50 class FreePagePool; | 50 class PagePool; |
| 51 | 51 |
| 52 class PLATFORM_EXPORT HeapAllocHooks { | 52 class PLATFORM_EXPORT HeapAllocHooks { |
| 53 public: | 53 public: |
| 54 // TODO(hajimehoshi): Pass a type name of the allocated object. | 54 // TODO(hajimehoshi): Pass a type name of the allocated object. |
| 55 typedef void AllocationHook(Address, size_t, const char*); | 55 typedef void AllocationHook(Address, size_t, const char*); |
| 56 typedef void FreeHook(Address); | 56 typedef void FreeHook(Address); |
| 57 | 57 |
| 58 static void setAllocationHook(AllocationHook* hook) { | 58 static void setAllocationHook(AllocationHook* hook) { |
| 59 m_allocationHook = hook; | 59 m_allocationHook = hook; |
| 60 } | 60 } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 #if DCHECK_IS_ON() | 435 #if DCHECK_IS_ON() |
| 436 Address checkAndMarkPointer(Visitor*, | 436 Address checkAndMarkPointer(Visitor*, |
| 437 Address, | 437 Address, |
| 438 MarkedPointerCallbackForTesting); | 438 MarkedPointerCallbackForTesting); |
| 439 #endif | 439 #endif |
| 440 | 440 |
| 441 size_t objectPayloadSizeForTesting(); | 441 size_t objectPayloadSizeForTesting(); |
| 442 | 442 |
| 443 void flushHeapDoesNotContainCache(); | 443 void flushHeapDoesNotContainCache(); |
| 444 | 444 |
| 445 FreePagePool* getFreePagePool() { return m_freePagePool.get(); } | 445 PagePool* getFreePagePool() { return m_freePagePool.get(); } |
| 446 | 446 |
| 447 // This look-up uses the region search tree and a negative contains cache to | 447 // This look-up uses the region search tree and a negative contains cache to |
| 448 // provide an efficient mapping from arbitrary addresses to the containing | 448 // provide an efficient mapping from arbitrary addresses to the containing |
| 449 // heap-page if one exists. | 449 // heap-page if one exists. |
| 450 BasePage* lookupPageForAddress(Address); | 450 BasePage* lookupPageForAddress(Address); |
| 451 | 451 |
| 452 static const GCInfo* gcInfo(size_t gcInfoIndex) { | 452 static const GCInfo* gcInfo(size_t gcInfoIndex) { |
| 453 ASSERT(gcInfoIndex >= 1); | 453 ASSERT(gcInfoIndex >= 1); |
| 454 ASSERT(gcInfoIndex < GCInfoTable::maxIndex); | 454 ASSERT(gcInfoIndex < GCInfoTable::maxIndex); |
| 455 ASSERT(s_gcInfoTable); | 455 ASSERT(s_gcInfoTable); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 472 | 472 |
| 473 void commitCallbackStacks(); | 473 void commitCallbackStacks(); |
| 474 void decommitCallbackStacks(); | 474 void decommitCallbackStacks(); |
| 475 | 475 |
| 476 RecursiveMutex m_threadAttachMutex; | 476 RecursiveMutex m_threadAttachMutex; |
| 477 ThreadStateSet m_threads; | 477 ThreadStateSet m_threads; |
| 478 ThreadHeapStats m_stats; | 478 ThreadHeapStats m_stats; |
| 479 std::unique_ptr<RegionTree> m_regionTree; | 479 std::unique_ptr<RegionTree> m_regionTree; |
| 480 std::unique_ptr<HeapDoesNotContainCache> m_heapDoesNotContainCache; | 480 std::unique_ptr<HeapDoesNotContainCache> m_heapDoesNotContainCache; |
| 481 std::unique_ptr<SafePointBarrier> m_safePointBarrier; | 481 std::unique_ptr<SafePointBarrier> m_safePointBarrier; |
| 482 std::unique_ptr<FreePagePool> m_freePagePool; | 482 std::unique_ptr<PagePool> m_freePagePool; |
| 483 std::unique_ptr<CallbackStack> m_markingStack; | 483 std::unique_ptr<CallbackStack> m_markingStack; |
| 484 std::unique_ptr<CallbackStack> m_postMarkingCallbackStack; | 484 std::unique_ptr<CallbackStack> m_postMarkingCallbackStack; |
| 485 std::unique_ptr<CallbackStack> m_globalWeakCallbackStack; | 485 std::unique_ptr<CallbackStack> m_globalWeakCallbackStack; |
| 486 std::unique_ptr<CallbackStack> m_ephemeronStack; | 486 std::unique_ptr<CallbackStack> m_ephemeronStack; |
| 487 BlinkGC::GCReason m_lastGCReason; | 487 BlinkGC::GCReason m_lastGCReason; |
| 488 StackFrameDepth m_stackFrameDepth; | 488 StackFrameDepth m_stackFrameDepth; |
| 489 | 489 |
| 490 std::unique_ptr<HeapCompact> m_compaction; | 490 std::unique_ptr<HeapCompact> m_compaction; |
| 491 | 491 |
| 492 static ThreadHeap* s_mainThreadHeap; | 492 static ThreadHeap* s_mainThreadHeap; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 T** cell = reinterpret_cast<T**>(object); | 697 T** cell = reinterpret_cast<T**>(object); |
| 698 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) | 698 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) |
| 699 *cell = nullptr; | 699 *cell = nullptr; |
| 700 } | 700 } |
| 701 | 701 |
| 702 } // namespace blink | 702 } // namespace blink |
| 703 | 703 |
| 704 #include "platform/heap/VisitorImpl.h" | 704 #include "platform/heap/VisitorImpl.h" |
| 705 | 705 |
| 706 #endif // Heap_h | 706 #endif // Heap_h |
| OLD | NEW |