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

Unified Diff: runtime/vm/compiler.h

Issue 1663163003: Initial split of precompilation code from compiler.cc (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebased Created 4 years, 10 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 | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.h
diff --git a/runtime/vm/compiler.h b/runtime/vm/compiler.h
index e193dbf856a212b72b13f5d1018980b4da5deba4..01822ace3c3d98544a6ce52bf641e9d39c8741d3 100644
--- a/runtime/vm/compiler.h
+++ b/runtime/vm/compiler.h
@@ -17,7 +17,9 @@ class BackgroundCompilationQueue;
class Class;
class Code;
class CompilationWorkQueue;
+class FlowGraph;
class Function;
+class IndirectGotoInstr;
class Library;
class ParsedFunction;
class QueueElement;
@@ -26,6 +28,54 @@ class Script;
class SequenceNode;
+class CompilationPipeline : public ZoneAllocated {
+ public:
+ static CompilationPipeline* New(Zone* zone, const Function& function);
+
+ virtual void ParseFunction(ParsedFunction* parsed_function) = 0;
+ virtual FlowGraph* BuildFlowGraph(
+ Zone* zone,
+ ParsedFunction* parsed_function,
+ const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t osr_id) = 0;
+ virtual void FinalizeCompilation() = 0;
+ virtual ~CompilationPipeline() { }
+};
+
+
+class DartCompilationPipeline : public CompilationPipeline {
+ public:
+ virtual void ParseFunction(ParsedFunction* parsed_function);
+
+ virtual FlowGraph* BuildFlowGraph(
+ Zone* zone,
+ ParsedFunction* parsed_function,
+ const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t osr_id);
+
+ virtual void FinalizeCompilation();
+};
+
+
+class IrregexpCompilationPipeline : public CompilationPipeline {
+ public:
+ IrregexpCompilationPipeline() : backtrack_goto_(NULL) { }
+
+ virtual void ParseFunction(ParsedFunction* parsed_function);
+
+ virtual FlowGraph* BuildFlowGraph(
+ Zone* zone,
+ ParsedFunction* parsed_function,
+ const ZoneGrowableArray<const ICData*>& ic_data_array,
+ intptr_t osr_id);
+
+ virtual void FinalizeCompilation();
+
+ private:
+ IndirectGotoInstr* backtrack_goto_;
+};
+
+
class Compiler : public AllStatic {
public:
static const intptr_t kNoOSRDeoptId = Thread::kNoDeoptId;
@@ -82,7 +132,6 @@ class Compiler : public AllStatic {
// The return value is either a RawInstance on success or a RawError
// on compilation failure.
static RawObject* EvaluateStaticInitializer(const Field& field);
- static void CompileStaticInitializer(const Field& field);
// Generates local var descriptors and sets it in 'code'. Do not call if the
// local var descriptor already exists.
@@ -93,8 +142,6 @@ class Compiler : public AllStatic {
// Returns Error::null() if there is no compilation error.
static RawError* CompileAllFunctions(const Class& cls);
- static bool always_optimize();
-
// Notify the compiler that background (optimized) compilation has failed
// because the mutator thread changed the state (e.g., deoptimization,
// deferred loading). The background compilation may retry to compile
« no previous file with comments | « no previous file | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698