Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: src/heap/incremental-marking-job.h

Issue 1813963002: Add memory pressure notification API (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: GC interrupt on kModerate to start incremental marking Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/incremental-marking-job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_INCREMENTAL_MARKING_JOB_H_ 5 #ifndef V8_HEAP_INCREMENTAL_MARKING_JOB_H_
6 #define V8_HEAP_INCREMENTAL_MARKING_JOB_H_ 6 #define V8_HEAP_INCREMENTAL_MARKING_JOB_H_
7 7
8 #include "src/cancelable-task.h" 8 #include "src/cancelable-task.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 : CancelableTask(isolate), job_(job) {} 42 : CancelableTask(isolate), job_(job) {}
43 static void Step(Heap* heap); 43 static void Step(Heap* heap);
44 // CancelableTask overrides. 44 // CancelableTask overrides.
45 void RunInternal() override; 45 void RunInternal() override;
46 46
47 private: 47 private:
48 IncrementalMarkingJob* job_; 48 IncrementalMarkingJob* job_;
49 }; 49 };
50 50
51 // Delay of the delayed task. 51 // Delay of the delayed task.
52 static const int kDelayInSeconds = 5; 52 static const double kLongDelayInSeconds;
53 static const double kShortDelayInSeconds;
53 54
54 IncrementalMarkingJob() 55 IncrementalMarkingJob()
55 : idle_task_pending_(false), 56 : idle_task_pending_(false),
56 delayed_task_pending_(false), 57 delayed_task_pending_(false),
57 made_progress_since_last_delayed_task_(false) {} 58 made_progress_since_last_delayed_task_(false) {}
58 59
59 bool ShouldForceMarkingStep() { 60 bool ShouldForceMarkingStep() {
60 return !made_progress_since_last_delayed_task_; 61 return !made_progress_since_last_delayed_task_;
61 } 62 }
62 63
63 bool IdleTaskPending() { return idle_task_pending_; } 64 bool IdleTaskPending() { return idle_task_pending_; }
64 65
65 void Start(Heap* heap); 66 void Start(Heap* heap);
66 67
67 void NotifyIdleTask(); 68 void NotifyIdleTask();
68 void NotifyDelayedTask(); 69 void NotifyDelayedTask();
69 void NotifyIdleTaskProgress(); 70 void NotifyIdleTaskProgress();
70 void ScheduleIdleTask(Heap* heap); 71 void ScheduleIdleTask(Heap* heap);
71 void ScheduleDelayedTask(Heap* heap); 72 void ScheduleDelayedTask(Heap* heap);
72 73
73 private: 74 private:
74 bool idle_task_pending_; 75 bool idle_task_pending_;
75 bool delayed_task_pending_; 76 bool delayed_task_pending_;
76 bool made_progress_since_last_delayed_task_; 77 bool made_progress_since_last_delayed_task_;
77 }; 78 };
78 } // namespace internal 79 } // namespace internal
79 } // namespace v8 80 } // namespace v8
80 81
81 #endif // V8_HEAP_INCREMENTAL_MARKING_JOB_H_ 82 #endif // V8_HEAP_INCREMENTAL_MARKING_JOB_H_
OLDNEW
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/incremental-marking-job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698