v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
minor-gc-job.h
Go to the documentation of this file.
1// Copyright 2015 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef V8_HEAP_MINOR_GC_JOB_H_
6#define V8_HEAP_MINOR_GC_JOB_H_
7
8#include <memory>
9
10#include "src/common/globals.h"
13
14namespace v8::internal {
15
16class Heap;
17
18// The job allows for running young generation garbage collection via platform
19// foreground tasks.
20//
21// The job automatically adds an observer to schedule a task when
22// `--minor_gc_task_trigger` in percent of the regular limit is reached. The job
23// itself never checks the schedule.
24class MinorGCJob final {
25 public:
27
28 // Tries to schedule a new minor GC task.
29 void TryScheduleTask();
30
31 // Cancels any previously scheduled minor GC tasks that have not yet run.
33
34 private:
35 class Task;
36
40
41 Heap* const heap_;
44 std::unique_ptr<AllocationObserver> minor_gc_task_observer_;
45};
46
47} // namespace v8::internal
48
49#endif // V8_HEAP_MINOR_GC_JOB_H_
MinorGCJob(Heap *heap) V8_NOEXCEPT
std::unique_ptr< AllocationObserver > minor_gc_task_observer_
CancelableTaskManager::Id current_task_id_
#define V8_NOEXCEPT