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

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

Issue 2531973002: Simple BlinkGC heap compaction. (Closed)
Patch Set: add pointer alignment handling to SparseHeapBitmap 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 4f04eb71dabdfa9b7ba3fd19a7f162bb88e87fbb..066af3b4e29549fee7d76162e99e71617fe6e26d 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.h
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.h
@@ -285,6 +285,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 {
@@ -322,6 +324,19 @@ class PLATFORM_EXPORT ThreadState {
ThreadState* const m_threadState;
};
+ class GCForbiddenScope final {
+ STACK_ALLOCATED();
+
+ public:
+ GCForbiddenScope(ThreadState* threadState) : m_threadState(threadState) {
haraken 2016/12/09 07:25:56 Add explicit.
sof 2016/12/09 21:44:05 Done.
+ m_threadState->enterGCForbiddenScope();
+ }
+ ~GCForbiddenScope() { m_threadState->leaveGCForbiddenScope(); }
+
+ private:
+ ThreadState* const m_threadState;
+ };
+
void flushHeapDoesNotContainCacheIfNeeded();
// Safepoint related functionality.
@@ -561,10 +576,14 @@ 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();
+ static const char* gcReasonString(BlinkGC::GCReason);
+
private:
enum SnapshotType { HeapSnapshot, FreelistSnapshot };

Powered by Google App Engine
This is Rietveld 408576698