Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: third_party/WebKit/Source/platform/heap/Heap.h

Issue 2684633004: Remove orphaned pages from Oilpan (Closed)
Patch Set: temp Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 30 matching lines...) Expand all
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 FreePagePool;
51 class OrphanedPagePool;
52 51
53 class PLATFORM_EXPORT HeapAllocHooks { 52 class PLATFORM_EXPORT HeapAllocHooks {
54 public: 53 public:
55 // TODO(hajimehoshi): Pass a type name of the allocated object. 54 // TODO(hajimehoshi): Pass a type name of the allocated object.
56 typedef void AllocationHook(Address, size_t, const char*); 55 typedef void AllocationHook(Address, size_t, const char*);
57 typedef void FreeHook(Address); 56 typedef void FreeHook(Address);
58 57
59 static void setAllocationHook(AllocationHook* hook) { 58 static void setAllocationHook(AllocationHook* hook) {
60 m_allocationHook = hook; 59 m_allocationHook = hook;
61 } 60 }
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 Address checkAndMarkPointer(Visitor*, 438 Address checkAndMarkPointer(Visitor*,
440 Address, 439 Address,
441 MarkedPointerCallbackForTesting); 440 MarkedPointerCallbackForTesting);
442 #endif 441 #endif
443 442
444 size_t objectPayloadSizeForTesting(); 443 size_t objectPayloadSizeForTesting();
445 444
446 void flushHeapDoesNotContainCache(); 445 void flushHeapDoesNotContainCache();
447 446
448 FreePagePool* getFreePagePool() { return m_freePagePool.get(); } 447 FreePagePool* getFreePagePool() { return m_freePagePool.get(); }
449 OrphanedPagePool* getOrphanedPagePool() { return m_orphanedPagePool.get(); }
450 448
451 // This look-up uses the region search tree and a negative contains cache to 449 // This look-up uses the region search tree and a negative contains cache to
452 // provide an efficient mapping from arbitrary addresses to the containing 450 // provide an efficient mapping from arbitrary addresses to the containing
453 // heap-page if one exists. 451 // heap-page if one exists.
454 BasePage* lookupPageForAddress(Address); 452 BasePage* lookupPageForAddress(Address);
455 453
456 static const GCInfo* gcInfo(size_t gcInfoIndex) { 454 static const GCInfo* gcInfo(size_t gcInfoIndex) {
457 ASSERT(gcInfoIndex >= 1); 455 ASSERT(gcInfoIndex >= 1);
458 ASSERT(gcInfoIndex < GCInfoTable::maxIndex); 456 ASSERT(gcInfoIndex < GCInfoTable::maxIndex);
459 ASSERT(s_gcInfoTable); 457 ASSERT(s_gcInfoTable);
(...skipping 17 matching lines...) Expand all
477 void commitCallbackStacks(); 475 void commitCallbackStacks();
478 void decommitCallbackStacks(); 476 void decommitCallbackStacks();
479 477
480 RecursiveMutex m_threadAttachMutex; 478 RecursiveMutex m_threadAttachMutex;
481 ThreadStateSet m_threads; 479 ThreadStateSet m_threads;
482 ThreadHeapStats m_stats; 480 ThreadHeapStats m_stats;
483 std::unique_ptr<RegionTree> m_regionTree; 481 std::unique_ptr<RegionTree> m_regionTree;
484 std::unique_ptr<HeapDoesNotContainCache> m_heapDoesNotContainCache; 482 std::unique_ptr<HeapDoesNotContainCache> m_heapDoesNotContainCache;
485 std::unique_ptr<SafePointBarrier> m_safePointBarrier; 483 std::unique_ptr<SafePointBarrier> m_safePointBarrier;
486 std::unique_ptr<FreePagePool> m_freePagePool; 484 std::unique_ptr<FreePagePool> m_freePagePool;
487 std::unique_ptr<OrphanedPagePool> m_orphanedPagePool;
488 std::unique_ptr<CallbackStack> m_markingStack; 485 std::unique_ptr<CallbackStack> m_markingStack;
489 std::unique_ptr<CallbackStack> m_postMarkingCallbackStack; 486 std::unique_ptr<CallbackStack> m_postMarkingCallbackStack;
490 std::unique_ptr<CallbackStack> m_globalWeakCallbackStack; 487 std::unique_ptr<CallbackStack> m_globalWeakCallbackStack;
491 std::unique_ptr<CallbackStack> m_ephemeronStack; 488 std::unique_ptr<CallbackStack> m_ephemeronStack;
492 BlinkGC::GCReason m_lastGCReason; 489 BlinkGC::GCReason m_lastGCReason;
493 StackFrameDepth m_stackFrameDepth; 490 StackFrameDepth m_stackFrameDepth;
494 491
495 std::unique_ptr<HeapCompact> m_compaction; 492 std::unique_ptr<HeapCompact> m_compaction;
496 493
497 static ThreadHeap* s_mainThreadHeap; 494 static ThreadHeap* s_mainThreadHeap;
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 T** cell = reinterpret_cast<T**>(object); 699 T** cell = reinterpret_cast<T**>(object);
703 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell)) 700 if (*cell && !ObjectAliveTrait<T>::isHeapObjectAlive(*cell))
704 *cell = nullptr; 701 *cell = nullptr;
705 } 702 }
706 703
707 } // namespace blink 704 } // namespace blink
708 705
709 #include "platform/heap/VisitorImpl.h" 706 #include "platform/heap/VisitorImpl.h"
710 707
711 #endif // Heap_h 708 #endif // Heap_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698