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

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

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: rebased upto r438110 Created 4 years 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
Index: third_party/WebKit/Source/platform/heap/ThreadState.h
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.h b/third_party/WebKit/Source/platform/heap/ThreadState.h
index a34732f7fd8565e8453072bbc26501db534c2a91..bc9940964e98c373c5bcf6e459d29684f235fd05 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.h
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.h
@@ -282,6 +282,8 @@ class PLATFORM_EXPORT ThreadState {
// the executions of mutators.
void makeConsistentForMutator();
+ void compact();
+
// Support for disallowing allocation. Mainly used for sanity
// checks asserts.
bool isAllocationAllowed() const {
@@ -320,6 +322,20 @@ class PLATFORM_EXPORT ThreadState {
ThreadState* const m_threadState;
};
+ class GCForbiddenScope final {
+ STACK_ALLOCATED();
+
+ public:
+ explicit GCForbiddenScope(ThreadState* threadState)
+ : m_threadState(threadState) {
+ m_threadState->enterGCForbiddenScope();
+ }
+ ~GCForbiddenScope() { m_threadState->leaveGCForbiddenScope(); }
+
+ private:
+ ThreadState* const m_threadState;
+ };
+
void flushHeapDoesNotContainCacheIfNeeded();
// Safepoint related functionality.
@@ -536,6 +552,8 @@ class PLATFORM_EXPORT ThreadState {
v8::Isolate* isolate() const { return m_isolate; }
+ BlinkGC::StackState stackState() const { return m_stackState; }
+
void collectGarbage(BlinkGC::StackState, BlinkGC::GCType, BlinkGC::GCReason);
void collectGarbageForTerminatingThread();
void collectAllGarbage();
@@ -560,6 +578,8 @@ class PLATFORM_EXPORT ThreadState {
}
};
+ static const char* gcReasonString(BlinkGC::GCReason);
+
private:
template <typename T>
friend class PrefinalizerRegistration;
« no previous file with comments | « third_party/WebKit/Source/platform/heap/SparseHeapBitmap.cpp ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698