OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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_PAGE_PARALLEL_JOB_ | 5 #ifndef V8_HEAP_PAGE_PARALLEL_JOB_ |
6 #define V8_HEAP_PAGE_PARALLEL_JOB_ | 6 #define V8_HEAP_PAGE_PARALLEL_JOB_ |
7 | 7 |
8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
9 #include "src/cancelable-task.h" | 9 #include "src/cancelable-task.h" |
10 #include "src/utils.h" | 10 #include "src/utils.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 bool success = JobTraits::ProcessPageInParallel( | 154 bool success = JobTraits::ProcessPageInParallel( |
155 heap_, data_, current->chunk, current->data); | 155 heap_, data_, current->chunk, current->data); |
156 current->state.SetValue(success ? kFinished : kFailed); | 156 current->state.SetValue(success ? kFinished : kFailed); |
157 } | 157 } |
158 current = current->next; | 158 current = current->next; |
159 // Wrap around if needed. | 159 // Wrap around if needed. |
160 if (current == nullptr) { | 160 if (current == nullptr) { |
161 current = items_; | 161 current = items_; |
162 } | 162 } |
163 } | 163 } |
164 on_finish_->Signal(); | 164 on_finish_->Signal("PageParallelJob::Task::RunInternal"); |
165 } | 165 } |
166 | 166 |
167 Heap* heap_; | 167 Heap* heap_; |
168 Item* items_; | 168 Item* items_; |
169 int num_items_; | 169 int num_items_; |
170 int start_index_; | 170 int start_index_; |
171 base::Semaphore* on_finish_; | 171 base::Semaphore* on_finish_; |
172 typename JobTraits::PerTaskData data_; | 172 typename JobTraits::PerTaskData data_; |
173 DISALLOW_COPY_AND_ASSIGN(Task); | 173 DISALLOW_COPY_AND_ASSIGN(Task); |
174 }; | 174 }; |
175 | 175 |
176 Heap* heap_; | 176 Heap* heap_; |
177 CancelableTaskManager* cancelable_task_manager_; | 177 CancelableTaskManager* cancelable_task_manager_; |
178 Item* items_; | 178 Item* items_; |
179 int num_items_; | 179 int num_items_; |
180 int num_tasks_; | 180 int num_tasks_; |
181 base::Semaphore* pending_tasks_; | 181 base::Semaphore* pending_tasks_; |
182 DISALLOW_COPY_AND_ASSIGN(PageParallelJob); | 182 DISALLOW_COPY_AND_ASSIGN(PageParallelJob); |
183 }; | 183 }; |
184 | 184 |
185 } // namespace internal | 185 } // namespace internal |
186 } // namespace v8 | 186 } // namespace v8 |
187 | 187 |
188 #endif // V8_HEAP_PAGE_PARALLEL_JOB_ | 188 #endif // V8_HEAP_PAGE_PARALLEL_JOB_ |
OLD | NEW |