summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/incremental-marking-job.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/incremental-marking-job.h')
-rw-r--r--deps/v8/src/heap/incremental-marking-job.h53
1 files changed, 10 insertions, 43 deletions
diff --git a/deps/v8/src/heap/incremental-marking-job.h b/deps/v8/src/heap/incremental-marking-job.h
index 9c78182f2e..ccc60c55cb 100644
--- a/deps/v8/src/heap/incremental-marking-job.h
+++ b/deps/v8/src/heap/incremental-marking-job.h
@@ -14,31 +14,13 @@ class Heap;
class Isolate;
// The incremental marking job uses platform tasks to perform incremental
-// marking steps. The job posts an idle and a delayed task with a large delay.
-// The delayed task performs steps only if the idle task is not making progress.
-// We expect this to be a rare event since incremental marking should finish
-// quickly with the help of the mutator and the idle task.
-// The delayed task guarantees that we eventually finish incremental marking
-// even if the mutator becomes idle and the platform stops running idle tasks,
-// which can happen for background tabs in Chrome.
+// marking steps. The job posts a foreground task that makes a small (~1ms)
+// step and posts another task until the marking is completed.
class IncrementalMarkingJob {
public:
- class IdleTask : public CancelableIdleTask {
+ class Task : public CancelableTask {
public:
- explicit IdleTask(Isolate* isolate, IncrementalMarkingJob* job)
- : CancelableIdleTask(isolate), job_(job) {}
- enum Progress { kDone, kMoreWork };
- static Progress Step(Heap* heap, double deadline_in_ms);
- // CancelableIdleTask overrides.
- void RunInternal(double deadline_in_seconds) override;
-
- private:
- IncrementalMarkingJob* job_;
- };
-
- class DelayedTask : public CancelableTask {
- public:
- explicit DelayedTask(Isolate* isolate, IncrementalMarkingJob* job)
+ explicit Task(Isolate* isolate, IncrementalMarkingJob* job)
: CancelableTask(isolate), job_(job) {}
static void Step(Heap* heap);
// CancelableTask overrides.
@@ -48,33 +30,18 @@ class IncrementalMarkingJob {
IncrementalMarkingJob* job_;
};
- // Delay of the delayed task.
- static const double kLongDelayInSeconds;
- static const double kShortDelayInSeconds;
-
- IncrementalMarkingJob()
- : idle_task_pending_(false),
- delayed_task_pending_(false),
- made_progress_since_last_delayed_task_(false) {}
+ IncrementalMarkingJob() : task_pending_(false) {}
- bool ShouldForceMarkingStep() {
- return !made_progress_since_last_delayed_task_;
- }
-
- bool IdleTaskPending() { return idle_task_pending_; }
+ bool TaskPending() { return task_pending_; }
void Start(Heap* heap);
- void NotifyIdleTask();
- void NotifyDelayedTask();
- void NotifyIdleTaskProgress();
- void ScheduleIdleTask(Heap* heap);
- void ScheduleDelayedTask(Heap* heap);
+ void NotifyTask();
+
+ void ScheduleTask(Heap* heap);
private:
- bool idle_task_pending_;
- bool delayed_task_pending_;
- bool made_progress_since_last_delayed_task_;
+ bool task_pending_;
};
} // namespace internal
} // namespace v8