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

Unified Diff: runtime/vm/flow_graph_builder.h

Issue 10014006: Try/catch in graph builder. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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/compiler.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.h
===================================================================
--- runtime/vm/flow_graph_builder.h (revision 6388)
+++ runtime/vm/flow_graph_builder.h (working copy)
@@ -18,11 +18,7 @@
// Build a flow graph from a parsed function's AST.
class FlowGraphBuilder: public ValueObject {
public:
- explicit FlowGraphBuilder(const ParsedFunction& parsed_function)
- : parsed_function_(parsed_function),
- preorder_block_entries_(),
- postorder_block_entries_(),
- context_level_(0) { }
+ explicit FlowGraphBuilder(const ParsedFunction& parsed_function);
void BuildGraph();
@@ -37,6 +33,15 @@
void set_context_level(intptr_t value) { context_level_ = value; }
intptr_t context_level() const { return context_level_; }
+ // Each try in this function gets its own try index.
+ intptr_t AllocateTryIndex() { return ++last_used_try_index_; }
+
+ // Manage the currently active try index.
+ void set_try_index(intptr_t value) { try_index_ = value; }
+ intptr_t try_index() const { return try_index_; }
+
+ void AddCatchEntry(intptr_t try_index, Instruction* entry);
+
private:
void ComputeDominators(GrowableArray<BlockEntryInstr*>* preorder,
GrowableArray<intptr_t>* parent);
@@ -49,6 +54,11 @@
GrowableArray<BlockEntryInstr*> preorder_block_entries_;
GrowableArray<BlockEntryInstr*> postorder_block_entries_;
intptr_t context_level_;
+ intptr_t last_used_try_index_;
+ intptr_t try_index_;
+ GrowableArray<Instruction*> catch_entries_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
};
@@ -163,6 +173,9 @@
int start_index,
Value* alloc_value);
+ void BuildStoreContext(const LocalVariable& variable, intptr_t start_index);
+ void BuildLoadContext(const LocalVariable& variable, intptr_t start_index);
+
void BuildThrowNode(ThrowNode* node);
private:
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/flow_graph_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698