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

Unified Diff: runtime/vm/flow_graph_builder.h

Issue 10857016: Refactored FlowGraphBuilder into a separate FlowGraph representation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added flow_graph.{h,cc} Created 8 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
Index: runtime/vm/flow_graph_builder.h
diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h
index 5af9547393fe5800e013b07f78d41d685e6dd227..7f576cd9d17bc3acefce8430175df600a23d57be 100644
--- a/runtime/vm/flow_graph_builder.h
+++ b/runtime/vm/flow_graph_builder.h
@@ -7,6 +7,7 @@
#include "vm/allocation.h"
#include "vm/ast.h"
+#include "vm/flow_graph.h"
#include "vm/growable_array.h"
#include "vm/intermediate_language.h"
@@ -18,16 +19,12 @@ class ParsedFunction;
// Build a flow graph from a parsed function's AST.
class FlowGraphBuilder: public ValueObject {
public:
- explicit FlowGraphBuilder(const ParsedFunction& parsed_function);
+ explicit FlowGraphBuilder(const FlowGraph& flow_graph);
- void BuildGraph(bool for_optimized, bool use_ssa);
+ GraphEntryInstr* BuildGraph();
const ParsedFunction& parsed_function() const { return parsed_function_; }
- const GrowableArray<BlockEntryInstr*>& postorder_block_entries() const {
- return postorder_block_entries_;
- }
-
void Bailout(const char* reason);
void set_context_level(intptr_t value) { context_level_ = value; }
@@ -42,14 +39,6 @@ class FlowGraphBuilder: public ValueObject {
void AddCatchEntry(TargetEntryInstr* entry);
- intptr_t current_ssa_temp_index() const {
- return current_ssa_temp_index_;
- }
-
- intptr_t alloc_ssa_temp_index() {
- return current_ssa_temp_index_++;
- }
-
intptr_t copied_parameter_count() const { return copied_parameter_count_; }
private:
@@ -60,39 +49,16 @@ class FlowGraphBuilder: public ValueObject {
return parameter_count() + stack_local_count_;
}
- void ComputeDominators(GrowableArray<BlockEntryInstr*>* preorder,
- GrowableArray<intptr_t>* parent,
- GrowableArray<BitVector*>* dominance_frontier);
-
- void CompressPath(intptr_t start_index,
- intptr_t current_index,
- GrowableArray<intptr_t>* parent,
- GrowableArray<intptr_t>* label);
-
- void Rename(GrowableArray<PhiInstr*>* live_phis);
- void RenameRecursive(BlockEntryInstr* block_entry,
- GrowableArray<Value*>* env,
- GrowableArray<PhiInstr*>* live_phis);
-
- void InsertPhis(const GrowableArray<BlockEntryInstr*>& preorder,
- const GrowableArray<BitVector*>& assigned_vars,
- const GrowableArray<BitVector*>& dom_frontier);
-
- void MarkLivePhis(GrowableArray<PhiInstr*>* live_phis);
-
const ParsedFunction& parsed_function_;
const intptr_t copied_parameter_count_;
const intptr_t non_copied_parameter_count_;
const intptr_t stack_local_count_; // Does not include any parameters.
- GrowableArray<BlockEntryInstr*> preorder_block_entries_;
- GrowableArray<BlockEntryInstr*> postorder_block_entries_;
intptr_t context_level_;
intptr_t last_used_try_index_;
intptr_t try_index_;
GraphEntryInstr* graph_entry_;
- intptr_t current_ssa_temp_index_;
DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder);
};

Powered by Google App Engine
This is Rietveld 408576698