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

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

Issue 2251713002: [Compiler] Add compile to CompilerDispatcherJob. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@offheap_compilerdispatcher
Patch Set: Fix comment Created 4 years, 4 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.cc ('k') | src/compiler-dispatcher/compiler-dispatcher-job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler-dispatcher/compiler-dispatcher-job.h
diff --git a/src/compiler-dispatcher/compiler-dispatcher-job.h b/src/compiler-dispatcher/compiler-dispatcher-job.h
index 50414af63948f6af96b6d9f74a8fcfb1b858b988..041b794956339bbfcc8f8faf995be016e344aa81 100644
--- a/src/compiler-dispatcher/compiler-dispatcher-job.h
+++ b/src/compiler-dispatcher/compiler-dispatcher-job.h
@@ -15,6 +15,7 @@ namespace v8 {
namespace internal {
class CompilationInfo;
+class CompilationJob;
class Isolate;
class JSFunction;
class ParseInfo;
@@ -28,7 +29,9 @@ enum class CompileJobStatus {
kInitial,
kReadyToParse,
kParsed,
+ kReadyToAnalyse,
kReadyToCompile,
+ kCompiled,
kFailed,
kDone,
};
@@ -43,6 +46,11 @@ class CompilerDispatcherJob {
bool can_parse_on_background_thread() const {
return can_parse_on_background_thread_;
}
+ // Should only be called after kReadyToCompile.
+ bool can_compile_on_background_thread() const {
+ DCHECK(compile_job_.get());
+ return can_compile_on_background_thread_;
+ }
// Transition from kInitial to kReadyToParse.
void PrepareToParseOnMainThread();
@@ -50,10 +58,21 @@ class CompilerDispatcherJob {
// Transition from kReadyToParse to kParsed.
void Parse();
- // Transition from kParsed to kReadyToCompile (or kFailed). Returns false
+ // Transition from kParsed to kReadyToAnalyse (or kFailed). Returns false
// when transitioning to kFailed. In that case, an exception is pending.
bool FinalizeParsingOnMainThread();
+ // Transition from kReadyToAnalyse to kReadyToCompile (or kFailed). Returns
+ // false when transitioning to kFailed. In that case, an exception is pending.
+ bool PrepareToCompileOnMainThread();
+
+ // Transition from kReadyToCompile to kCompiled.
+ void Compile();
+
+ // Transition from kCompiled to kDone (or kFailed). Returns false when
+ // transitioning to kFailed. In that case, an exception is pending.
+ bool FinalizeCompilingOnMainThread();
+
// Transition from any state to kInitial and free all resources.
void ResetOnMainThread();
@@ -74,7 +93,12 @@ class CompilerDispatcherJob {
std::unique_ptr<Parser> parser_;
std::unique_ptr<DeferredHandles> handles_from_parsing_;
+ // Members required for compiling.
+ std::unique_ptr<CompilationInfo> compile_info_;
+ std::unique_ptr<CompilationJob> compile_job_;
+
bool can_parse_on_background_thread_;
+ bool can_compile_on_background_thread_;
DISALLOW_COPY_AND_ASSIGN(CompilerDispatcherJob);
};
« no previous file with comments | « src/compiler.cc ('k') | src/compiler-dispatcher/compiler-dispatcher-job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698