| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_SCAVENGE_JOB_H_ | 5 #ifndef V8_HEAP_SCAVENGE_JOB_H_ |
| 6 #define V8_HEAP_SCAVENGE_JOB_H_ | 6 #define V8_HEAP_SCAVENGE_JOB_H_ |
| 7 | 7 |
| 8 #include "src/cancelable-task.h" | 8 #include "src/cancelable-task.h" |
| 9 #include "src/globals.h" |
| 9 #include "src/heap/gc-tracer.h" | 10 #include "src/heap/gc-tracer.h" |
| 10 | 11 |
| 11 namespace v8 { | 12 namespace v8 { |
| 12 namespace internal { | 13 namespace internal { |
| 13 | 14 |
| 14 class Heap; | 15 class Heap; |
| 15 class Isolate; | 16 class Isolate; |
| 16 | 17 |
| 17 | 18 |
| 18 // This class posts idle tasks and performs scavenges in the idle tasks. | 19 // This class posts idle tasks and performs scavenges in the idle tasks. |
| 19 class ScavengeJob { | 20 class V8_EXPORT_PRIVATE ScavengeJob { |
| 20 public: | 21 public: |
| 21 class IdleTask : public CancelableIdleTask { | 22 class IdleTask : public CancelableIdleTask { |
| 22 public: | 23 public: |
| 23 explicit IdleTask(Isolate* isolate, ScavengeJob* job) | 24 explicit IdleTask(Isolate* isolate, ScavengeJob* job) |
| 24 : CancelableIdleTask(isolate), job_(job) {} | 25 : CancelableIdleTask(isolate), job_(job) {} |
| 25 // CancelableIdleTask overrides. | 26 // CancelableIdleTask overrides. |
| 26 void RunInternal(double deadline_in_seconds) override; | 27 void RunInternal(double deadline_in_seconds) override; |
| 27 | 28 |
| 28 private: | 29 private: |
| 29 ScavengeJob* job_; | 30 ScavengeJob* job_; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 private: | 72 private: |
| 72 void ScheduleIdleTask(Heap* heap); | 73 void ScheduleIdleTask(Heap* heap); |
| 73 bool idle_task_pending_; | 74 bool idle_task_pending_; |
| 74 bool idle_task_rescheduled_; | 75 bool idle_task_rescheduled_; |
| 75 int bytes_allocated_since_the_last_task_; | 76 int bytes_allocated_since_the_last_task_; |
| 76 }; | 77 }; |
| 77 } // namespace internal | 78 } // namespace internal |
| 78 } // namespace v8 | 79 } // namespace v8 |
| 79 | 80 |
| 80 #endif // V8_HEAP_SCAVENGE_JOB_H_ | 81 #endif // V8_HEAP_SCAVENGE_JOB_H_ |
| OLD | NEW |