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

Side by Side Diff: src/heap/page-parallel-job.h

Issue 2872063003: [heap] Bound number of tasks by embedder limit instead of artificially capping (Closed)
Patch Set: Fix compilation Created 3 years, 7 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/mark-compact.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 while (item != nullptr) { 113 while (item != nullptr) {
114 bool success = (item->state.Value() == kFinished); 114 bool success = (item->state.Value() == kFinished);
115 JobTraits::FinalizePageSequentially(heap_, item->chunk, success, 115 JobTraits::FinalizePageSequentially(heap_, item->chunk, success,
116 item->data); 116 item->data);
117 item = item->next; 117 item = item->next;
118 } 118 }
119 } 119 }
120 } 120 }
121 121
122 private: 122 private:
123 static const int kMaxNumberOfTasks = 10; 123 static const int kMaxNumberOfTasks = 32;
124 124
125 enum ProcessingState { kAvailable, kProcessing, kFinished, kFailed }; 125 enum ProcessingState { kAvailable, kProcessing, kFinished, kFailed };
126 126
127 struct Item : public Malloced { 127 struct Item : public Malloced {
128 Item(MemoryChunk* chunk, typename JobTraits::PerPageData data, Item* next) 128 Item(MemoryChunk* chunk, typename JobTraits::PerPageData data, Item* next)
129 : chunk(chunk), state(kAvailable), data(data), next(next) {} 129 : chunk(chunk), state(kAvailable), data(data), next(next) {}
130 MemoryChunk* chunk; 130 MemoryChunk* chunk;
131 base::AtomicValue<ProcessingState> state; 131 base::AtomicValue<ProcessingState> state;
132 typename JobTraits::PerPageData data; 132 typename JobTraits::PerPageData data;
133 Item* next; 133 Item* next;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 int num_items_; 186 int num_items_;
187 int num_tasks_; 187 int num_tasks_;
188 base::Semaphore* pending_tasks_; 188 base::Semaphore* pending_tasks_;
189 DISALLOW_COPY_AND_ASSIGN(PageParallelJob); 189 DISALLOW_COPY_AND_ASSIGN(PageParallelJob);
190 }; 190 };
191 191
192 } // namespace internal 192 } // namespace internal
193 } // namespace v8 193 } // namespace v8
194 194
195 #endif // V8_HEAP_PAGE_PARALLEL_JOB_ 195 #endif // V8_HEAP_PAGE_PARALLEL_JOB_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698