Commit 3c62f7ae authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Use all available workers for concurrent marking.

R=ulan@chromium.org

Bug: chromium:812178
Change-Id: I35a727cb6c663bbd5f1beab98324e5d1b1ecf5c7
Reviewed-on: https://chromium-review.googlesource.com/918663
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51458}
parent 28c81eee
...@@ -506,14 +506,10 @@ void ConcurrentMarking::ScheduleTasks() { ...@@ -506,14 +506,10 @@ void ConcurrentMarking::ScheduleTasks() {
base::LockGuard<base::Mutex> guard(&pending_lock_); base::LockGuard<base::Mutex> guard(&pending_lock_);
DCHECK_EQ(0, pending_task_count_); DCHECK_EQ(0, pending_task_count_);
if (task_count_ == 0) { if (task_count_ == 0) {
// TODO(ulan): Increase the number of tasks for platforms that benefit task_count_ = Max(
// from it. 1, Min(kMaxTasks,
task_count_ = static_cast<int>(V8::GetCurrentPlatform()
(static_cast<int>( ->NumberOfAvailableBackgroundThreads())));
V8::GetCurrentPlatform()->NumberOfAvailableBackgroundThreads()) +
1) /
2;
task_count_ = Max(Min(task_count_, kMaxTasks), 1);
} }
// Task id 0 is for the main thread. // Task id 0 is for the main thread.
for (int i = 1; i <= task_count_; i++) { for (int i = 1; i <= task_count_; i++) {
......
...@@ -53,7 +53,7 @@ class ConcurrentMarking { ...@@ -53,7 +53,7 @@ class ConcurrentMarking {
COMPLETE_TASKS_FOR_TESTING, COMPLETE_TASKS_FOR_TESTING,
}; };
static constexpr int kMaxTasks = 4; static constexpr int kMaxTasks = 8;
using MarkingWorklist = Worklist<HeapObject*, 64 /* segment size */>; using MarkingWorklist = Worklist<HeapObject*, 64 /* segment size */>;
ConcurrentMarking(Heap* heap, MarkingWorklist* shared, ConcurrentMarking(Heap* heap, MarkingWorklist* shared,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment