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

Side by Side Diff: src/compiler-dispatcher/compiler-dispatcher.cc

Issue 2625413004: [compiler-dispatcher] make it so that we can always parse on bg threads (Closed)
Patch Set: Created 3 years, 11 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
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 #include "src/compiler-dispatcher/compiler-dispatcher.h" 5 #include "src/compiler-dispatcher/compiler-dispatcher.h"
6 6
7 #include "include/v8-platform.h" 7 #include "include/v8-platform.h"
8 #include "include/v8.h" 8 #include "include/v8.h"
9 #include "src/base/platform/time.h" 9 #include "src/base/platform/time.h"
10 #include "src/cancelable-task.h" 10 #include "src/cancelable-task.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 } 61 }
62 return job->status() != CompileJobStatus::kFailed; 62 return job->status() != CompileJobStatus::kFailed;
63 } 63 }
64 64
65 bool IsFinished(CompilerDispatcherJob* job) { 65 bool IsFinished(CompilerDispatcherJob* job) {
66 return job->status() == CompileJobStatus::kDone || 66 return job->status() == CompileJobStatus::kDone ||
67 job->status() == CompileJobStatus::kFailed; 67 job->status() == CompileJobStatus::kFailed;
68 } 68 }
69 69
70 bool CanRunOnAnyThread(CompilerDispatcherJob* job) { 70 bool CanRunOnAnyThread(CompilerDispatcherJob* job) {
71 return (job->status() == CompileJobStatus::kReadyToParse && 71 return (job->status() == CompileJobStatus::kReadyToParse) ||
vogelheim 2017/01/13 15:20:22 style nitpick: parentheses aren't really needed. S
jochen (gone - plz use gerrit) 2017/01/13 16:14:40 done
72 job->can_parse_on_background_thread()) || 72 (job->status() == CompileJobStatus::kReadyToCompile);
rmcilroy 2017/01/13 15:56:22 This now implicitly assumes the compiler dispatche
jochen (gone - plz use gerrit) 2017/01/13 16:14:40 done
73 (job->status() == CompileJobStatus::kReadyToCompile &&
74 job->can_compile_on_background_thread());
75 } 73 }
76 74
77 void DoNextStepOnBackgroundThread(CompilerDispatcherJob* job) { 75 void DoNextStepOnBackgroundThread(CompilerDispatcherJob* job) {
78 DCHECK(CanRunOnAnyThread(job)); 76 DCHECK(CanRunOnAnyThread(job));
79 switch (job->status()) { 77 switch (job->status()) {
80 case CompileJobStatus::kReadyToParse: 78 case CompileJobStatus::kReadyToParse:
81 job->Parse(); 79 job->Parse();
82 break; 80 break;
83 81
84 case CompileJobStatus::kReadyToCompile: 82 case CompileJobStatus::kReadyToCompile:
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 lock.reset(); 620 lock.reset();
623 DoNextStepOnMainThread(isolate_, job->second.get(), 621 DoNextStepOnMainThread(isolate_, job->second.get(),
624 ExceptionHandling::kSwallow); 622 ExceptionHandling::kSwallow);
625 } 623 }
626 } 624 }
627 if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded(); 625 if (jobs_.size() > too_long_jobs) ScheduleIdleTaskIfNeeded();
628 } 626 }
629 627
630 } // namespace internal 628 } // namespace internal
631 } // namespace v8 629 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698