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

Unified Diff: src/compiler-dispatcher/optimizing-compile-dispatcher.cc

Issue 2662883003: Add a test for OptimizingCompileDispatcher::Flush's non-blocking behavior (Closed)
Patch Set: updates 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler-dispatcher/optimizing-compile-dispatcher.h ('k') | test/unittests/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler-dispatcher/optimizing-compile-dispatcher.cc
diff --git a/src/compiler-dispatcher/optimizing-compile-dispatcher.cc b/src/compiler-dispatcher/optimizing-compile-dispatcher.cc
index 11695063848721b75fb54df93017badb314de1ca..8c578ca30c20a8293b81ae0a5d85bda63a93f8f8 100644
--- a/src/compiler-dispatcher/optimizing-compile-dispatcher.cc
+++ b/src/compiler-dispatcher/optimizing-compile-dispatcher.cc
@@ -33,11 +33,11 @@ void DisposeCompilationJob(CompilationJob* job, bool restore_function_code) {
class OptimizingCompileDispatcher::CompileTask : public v8::Task {
public:
- explicit CompileTask(Isolate* isolate) : isolate_(isolate) {
- OptimizingCompileDispatcher* dispatcher =
- isolate_->optimizing_compile_dispatcher();
- base::LockGuard<base::Mutex> lock_guard(&dispatcher->ref_count_mutex_);
- ++dispatcher->ref_count_;
+ explicit CompileTask(Isolate* isolate,
+ OptimizingCompileDispatcher* dispatcher)
+ : isolate_(isolate), dispatcher_(dispatcher) {
+ base::LockGuard<base::Mutex> lock_guard(&dispatcher_->ref_count_mutex_);
+ ++dispatcher_->ref_count_;
}
virtual ~CompileTask() {}
@@ -49,30 +49,29 @@ class OptimizingCompileDispatcher::CompileTask : public v8::Task {
DisallowHandleAllocation no_handles;
DisallowHandleDereference no_deref;
- OptimizingCompileDispatcher* dispatcher =
- isolate_->optimizing_compile_dispatcher();
{
TimerEventScope<TimerEventRecompileConcurrent> timer(isolate_);
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.compile"),
"V8.RecompileConcurrent");
- if (dispatcher->recompilation_delay_ != 0) {
+ if (dispatcher_->recompilation_delay_ != 0) {
base::OS::Sleep(base::TimeDelta::FromMilliseconds(
- dispatcher->recompilation_delay_));
+ dispatcher_->recompilation_delay_));
}
- dispatcher->CompileNext(dispatcher->NextInput(true));
+ dispatcher_->CompileNext(dispatcher_->NextInput(true));
}
{
- base::LockGuard<base::Mutex> lock_guard(&dispatcher->ref_count_mutex_);
- if (--dispatcher->ref_count_ == 0) {
- dispatcher->ref_count_zero_.NotifyOne();
+ base::LockGuard<base::Mutex> lock_guard(&dispatcher_->ref_count_mutex_);
+ if (--dispatcher_->ref_count_ == 0) {
+ dispatcher_->ref_count_zero_.NotifyOne();
}
}
}
Isolate* isolate_;
+ OptimizingCompileDispatcher* dispatcher_;
DISALLOW_COPY_AND_ASSIGN(CompileTask);
};
@@ -222,14 +221,14 @@ void OptimizingCompileDispatcher::QueueForOptimization(CompilationJob* job) {
blocked_jobs_++;
} else {
V8::GetCurrentPlatform()->CallOnBackgroundThread(
- new CompileTask(isolate_), v8::Platform::kShortRunningTask);
+ new CompileTask(isolate_, this), v8::Platform::kShortRunningTask);
}
}
void OptimizingCompileDispatcher::Unblock() {
while (blocked_jobs_ > 0) {
V8::GetCurrentPlatform()->CallOnBackgroundThread(
- new CompileTask(isolate_), v8::Platform::kShortRunningTask);
+ new CompileTask(isolate_, this), v8::Platform::kShortRunningTask);
blocked_jobs_--;
}
}
« no previous file with comments | « src/compiler-dispatcher/optimizing-compile-dispatcher.h ('k') | test/unittests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698