• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SCAVENGE_JOB_H_
6 #define V8_HEAP_SCAVENGE_JOB_H_
7 
8 #include "src/tasks/cancelable-task.h"
9 
10 namespace v8 {
11 namespace internal {
12 
13 class Heap;
14 class Isolate;
15 
16 // The scavenge job uses platform tasks to perform a young generation
17 // Scavenge garbage collection. The job posts a foreground task.
18 class ScavengeJob {
19  public:
20   ScavengeJob() V8_NOEXCEPT = default;
21 
22   void ScheduleTaskIfNeeded(Heap* heap);
23 
24   static size_t YoungGenerationTaskTriggerSize(Heap* heap);
25 
26  private:
27   class Task;
28 
29   static bool YoungGenerationSizeTaskTriggerReached(Heap* heap);
30 
set_task_pending(bool value)31   void set_task_pending(bool value) { task_pending_ = value; }
32 
33   bool task_pending_ = false;
34 };
35 }  // namespace internal
36 }  // namespace v8
37 
38 #endif  // V8_HEAP_SCAVENGE_JOB_H_
39