OLD | NEW |
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 #include "src/heap/incremental-marking-job.h" | 5 #include "src/heap/incremental-marking-job.h" |
6 | 6 |
7 #include "src/base/platform/time.h" | 7 #include "src/base/platform/time.h" |
8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
9 #include "src/heap/heap.h" | 9 #include "src/heap/heap.h" |
10 #include "src/heap/incremental-marking.h" | 10 #include "src/heap/incremental-marking.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 if (V8::GetCurrentPlatform()->IdleTasksEnabled(isolate)) { | 46 if (V8::GetCurrentPlatform()->IdleTasksEnabled(isolate)) { |
47 idle_task_pending_ = true; | 47 idle_task_pending_ = true; |
48 auto task = new IdleTask(heap->isolate(), this); | 48 auto task = new IdleTask(heap->isolate(), this); |
49 V8::GetCurrentPlatform()->CallIdleOnForegroundThread(isolate, task); | 49 V8::GetCurrentPlatform()->CallIdleOnForegroundThread(isolate, task); |
50 } | 50 } |
51 } | 51 } |
52 } | 52 } |
53 | 53 |
54 | 54 |
55 void IncrementalMarkingJob::ScheduleDelayedTask(Heap* heap) { | 55 void IncrementalMarkingJob::ScheduleDelayedTask(Heap* heap) { |
56 if (!delayed_task_pending_) { | 56 if (!delayed_task_pending_ && FLAG_memory_reducer) { |
57 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(heap->isolate()); | 57 v8::Isolate* isolate = reinterpret_cast<v8::Isolate*>(heap->isolate()); |
58 delayed_task_pending_ = true; | 58 delayed_task_pending_ = true; |
59 made_progress_since_last_delayed_task_ = false; | 59 made_progress_since_last_delayed_task_ = false; |
60 auto task = new DelayedTask(heap->isolate(), this); | 60 auto task = new DelayedTask(heap->isolate(), this); |
61 V8::GetCurrentPlatform()->CallDelayedOnForegroundThread(isolate, task, | 61 V8::GetCurrentPlatform()->CallDelayedOnForegroundThread(isolate, task, |
62 kDelayInSeconds); | 62 kDelayInSeconds); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 | 66 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } | 136 } |
137 // The Step() above could have finished incremental marking. | 137 // The Step() above could have finished incremental marking. |
138 if (!incremental_marking->IsStopped()) { | 138 if (!incremental_marking->IsStopped()) { |
139 job_->ScheduleDelayedTask(heap); | 139 job_->ScheduleDelayedTask(heap); |
140 } | 140 } |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 } // namespace internal | 144 } // namespace internal |
145 } // namespace v8 | 145 } // namespace v8 |
OLD | NEW |