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

Unified Diff: runtime/vm/kernel_to_il.h

Issue 2776373002: Initial steps into streaming the kernel flowgraph (Closed)
Patch Set: Rebase + fix lint error Created 3 years, 9 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 | « runtime/vm/kernel_binary_flowgraph.cc ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/kernel_to_il.h
diff --git a/runtime/vm/kernel_to_il.h b/runtime/vm/kernel_to_il.h
index 9dd05e60263b2582f55c320b138478d116be6367..6bcf8661634ced939dfc7986f026ceeed58c1154 100644
--- a/runtime/vm/kernel_to_il.h
+++ b/runtime/vm/kernel_to_il.h
@@ -18,6 +18,8 @@
namespace dart {
namespace kernel {
+class StreamingFlowGraphBuilder;
+
// TODO(27590): Instead of using [dart::kernel::TreeNode]s as keys we
// should use [TokenPosition]s.
class KernelConstMapKeyEqualsTraits {
@@ -737,7 +739,6 @@ class ScopeBuilder : public RecursiveVisitor {
intptr_t name_index_;
};
-
class FlowGraphBuilder : public ExpressionVisitor, public StatementVisitor {
public:
FlowGraphBuilder(TreeNode* node,
@@ -1067,16 +1068,48 @@ class FlowGraphBuilder : public ExpressionVisitor, public StatementVisitor {
DartTypeTranslator type_translator_;
ConstantEvaluator constant_evaluator_;
+ StreamingFlowGraphBuilder* streaming_flow_graph_builder_;
+
friend class BreakableBlock;
friend class CatchBlock;
friend class ConstantEvaluator;
friend class DartTypeTranslator;
+ friend class StreamingFlowGraphBuilder;
friend class ScopeBuilder;
friend class SwitchBlock;
friend class TryCatchBlock;
friend class TryFinallyBlock;
};
+
+class CatchBlock {
+ public:
+ CatchBlock(FlowGraphBuilder* builder,
+ LocalVariable* exception_var,
+ LocalVariable* stack_trace_var,
+ intptr_t catch_try_index)
+ : builder_(builder),
+ outer_(builder->catch_block_),
+ exception_var_(exception_var),
+ stack_trace_var_(stack_trace_var),
+ catch_try_index_(catch_try_index) {
+ builder_->catch_block_ = this;
+ }
+ ~CatchBlock() { builder_->catch_block_ = outer_; }
+
+ LocalVariable* exception_var() { return exception_var_; }
+ LocalVariable* stack_trace_var() { return stack_trace_var_; }
+ intptr_t catch_try_index() { return catch_try_index_; }
+
+ private:
+ FlowGraphBuilder* builder_;
+ CatchBlock* outer_;
+ LocalVariable* exception_var_;
+ LocalVariable* stack_trace_var_;
+ intptr_t catch_try_index_;
+};
+
+
RawObject* EvaluateMetadata(TreeNode* const kernel_node);
RawObject* BuildParameterDescriptor(TreeNode* const kernel_node);
« no previous file with comments | « runtime/vm/kernel_binary_flowgraph.cc ('k') | runtime/vm/kernel_to_il.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698