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

Unified Diff: Source/platform/heap/ThreadState.h

Issue 618353004: Revert "Oilpan: Replace the positive heap-contains cache with a binary search tree of memory region… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 3bef0bfe58bb2dbb31111b2eed59770d89f15af3..2513756aae2b550b1871a7f1c07efebffb3c35b5 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -52,6 +52,7 @@ class BaseHeap;
class BaseHeapPage;
class FinalizedHeapObjectHeader;
struct GCInfo;
+class HeapContainsCache;
class HeapObjectHeader;
class PageMemory;
class PersistentNode;
@@ -61,7 +62,6 @@ class SafePointBarrier;
class SafePointAwareMutexLocker;
template<typename Header> class ThreadHeap;
class CallbackStack;
-class PageMemoryRegion;
typedef uint8_t* Address;
@@ -548,6 +548,7 @@ public:
// Infrastructure to determine if an address is within one of the
// address ranges for the Blink heap. If the address is in the Blink
// heap the containing heap page is returned.
+ HeapContainsCache* heapContainsCache() { return m_heapContainsCache.get(); }
BaseHeapPage* contains(Address address) { return heapPageFromAddress(address); }
BaseHeapPage* contains(void* pointer) { return contains(reinterpret_cast<Address>(pointer)); }
BaseHeapPage* contains(const void* pointer) { return contains(const_cast<void*>(pointer)); }
@@ -578,6 +579,10 @@ public:
// Visit all persistents allocated on this thread.
void visitPersistents(Visitor*);
+ // Checks a given address and if a pointer into the oilpan heap marks
+ // the object to which it points.
+ bool checkAndMarkPointer(Visitor*, Address);
+
#if ENABLE(GC_PROFILE_MARKING)
const GCInfo* findGCInfo(Address);
static const GCInfo* findGCInfoFromAllThreads(Address);
@@ -626,8 +631,6 @@ public:
Mutex& sweepMutex() { return m_sweepMutex; }
- Vector<PageMemoryRegion*>& allocatedRegionsSinceLastGC() { return m_allocatedRegionsSinceLastGC; }
-
private:
explicit ThreadState();
~ThreadState();
@@ -700,6 +703,7 @@ private:
size_t m_noAllocationCount;
bool m_inGC;
BaseHeap* m_heaps[NumberOfHeaps];
+ OwnPtr<HeapContainsCache> m_heapContainsCache;
HeapStats m_stats;
HeapStats m_statsAfterLastGC;
@@ -718,8 +722,6 @@ private:
#if defined(ADDRESS_SANITIZER)
void* m_asanFakeStack;
#endif
-
- Vector<PageMemoryRegion*> m_allocatedRegionsSinceLastGC;
};
template<ThreadAffinity affinity> class ThreadStateFor;
@@ -820,7 +822,13 @@ public:
ThreadState* threadState() const { return m_threadState; }
const GCInfo* gcInfo() { return m_gcInfo; }
virtual bool isLargeObject() { return false; }
- virtual void markOrphaned();
+ virtual void markOrphaned()
+ {
+ m_threadState = 0;
+ m_gcInfo = 0;
+ m_terminating = false;
+ m_tracedAfterOrphaned = false;
+ }
bool orphaned() { return !m_threadState; }
bool terminating() { return m_terminating; }
void setTerminating() { m_terminating = true; }
« no previous file with comments | « Source/platform/heap/HeapTest.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698