summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/minor-gc-job.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/minor-gc-job.h')
-rw-r--r--deps/v8/src/heap/minor-gc-job.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/deps/v8/src/heap/minor-gc-job.h b/deps/v8/src/heap/minor-gc-job.h
new file mode 100644
index 0000000000..a3aa8b6dcf
--- /dev/null
+++ b/deps/v8/src/heap/minor-gc-job.h
@@ -0,0 +1,37 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef V8_HEAP_MINOR_GC_JOB_H_
+#define V8_HEAP_MINOR_GC_JOB_H_
+
+#include "src/common/globals.h"
+#include "src/tasks/cancelable-task.h"
+
+namespace v8 {
+namespace internal {
+
+class Heap;
+class Isolate;
+
+// The scavenge job uses platform tasks to perform a young generation
+// Scavenge garbage collection. The job posts a foreground task.
+class MinorGCJob {
+ public:
+ MinorGCJob() V8_NOEXCEPT = default;
+
+ void ScheduleTaskIfNeeded(Heap* heap);
+
+ static size_t YoungGenerationTaskTriggerSize(Heap* heap);
+
+ private:
+ class Task;
+
+ static bool YoungGenerationSizeTaskTriggerReached(Heap* heap);
+
+ bool task_pending_ = false;
+};
+} // namespace internal
+} // namespace v8
+
+#endif // V8_HEAP_MINOR_GC_JOB_H_