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

Unified Diff: src/compiler-dispatcher/compiler-dispatcher-job.cc

Issue 2573493002: Use idle time to make progress on scheduled compilation jobs (Closed)
Patch Set: updates Created 4 years 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
Index: src/compiler-dispatcher/compiler-dispatcher-job.cc
diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.cc b/src/compiler-dispatcher/compiler-dispatcher-job.cc
index b9e956caadde172d2c0db335d683f4a7f4c0f521..0513b18499412c115db18a6415522428b87077ff 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.cc
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.cc
@@ -263,5 +263,36 @@ void CompilerDispatcherJob::ResetOnMainThread() {
status_ = CompileJobStatus::kInitial;
}
+double CompilerDispatcherJob::EstimateRuntimeOfNextStepInMs() const {
+ switch (status_) {
+ case CompileJobStatus::kInitial:
+ return tracer_->EstimatePrepareToParseInMs();
+
+ case CompileJobStatus::kReadyToParse:
+ return tracer_->EstimateParseInMs(parse_info_->end_position() -
+ parse_info_->start_position());
+
+ case CompileJobStatus::kParsed:
+ return tracer_->EstimateFinalizeParsingInMs();
+
+ case CompileJobStatus::kReadyToAnalyse:
+ return tracer_->EstimatePrepareToCompileInMs();
+
+ case CompileJobStatus::kReadyToCompile:
+ return tracer_->EstimateCompileInMs(
+ parse_info_->literal()->ast_node_count());
+
+ case CompileJobStatus::kCompiled:
+ return tracer_->EstimateFinalizeCompilingInMs();
+
+ case CompileJobStatus::kFailed:
+ case CompileJobStatus::kDone:
+ return 0.0;
+ }
+
+ UNREACHABLE();
+ return 0.0;
+}
+
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler-dispatcher/compiler-dispatcher-job.h ('k') | src/compiler-dispatcher/compiler-dispatcher-tracer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698