Chromium Code Reviews| Index: runtime/vm/flow_graph_builder.h |
| diff --git a/runtime/vm/flow_graph_builder.h b/runtime/vm/flow_graph_builder.h |
| index 7c937966731176c63af2cd7507e1675f14bb84d8..7fe7fc4747f0b8cf34594b905233584a23129eb1 100644 |
| --- a/runtime/vm/flow_graph_builder.h |
| +++ b/runtime/vm/flow_graph_builder.h |
| @@ -28,7 +28,7 @@ class FlowGraphBuilder: public ValueObject { |
| kTestContext |
| }; |
| - FlowGraph* BuildGraph(InliningContext context); |
| + FlowGraph* BuildGraph(InliningContext context, intptr_t initial_loop_depth); |
| const ParsedFunction& parsed_function() const { return parsed_function_; } |
| @@ -106,11 +106,14 @@ class TestGraphVisitor; |
| // - (i0, i1): an open graph fragment |
| class EffectGraphVisitor : public AstNodeVisitor { |
| public: |
| - EffectGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index) |
| + EffectGraphVisitor(FlowGraphBuilder* owner, |
| + intptr_t temp_index, |
| + intptr_t loop_depth) |
| : owner_(owner), |
| temp_index_(temp_index), |
| entry_(NULL), |
| - exit_(NULL) { } |
| + exit_(NULL), |
| + loop_depth_(loop_depth) { } |
| #define DEFINE_VISIT(type, name) virtual void Visit##type(type* node); |
| NODE_LIST(DEFINE_VISIT) |
| @@ -118,6 +121,7 @@ class EffectGraphVisitor : public AstNodeVisitor { |
| FlowGraphBuilder* owner() const { return owner_; } |
| intptr_t temp_index() const { return temp_index_; } |
| + intptr_t loop_depth() const { return loop_depth_; } |
| Instruction* entry() const { return entry_; } |
| Instruction* exit() const { return exit_; } |
| @@ -282,6 +286,9 @@ class EffectGraphVisitor : public AstNodeVisitor { |
| // Output parameters. |
| Instruction* entry_; |
| Instruction* exit_; |
| + |
| + // Internal state. |
| + intptr_t loop_depth_; |
|
srdjan
2012/10/25 20:38:50
const ?
zerny-google
2012/10/29 16:44:25
Done.
|
| }; |
| @@ -292,8 +299,10 @@ class EffectGraphVisitor : public AstNodeVisitor { |
| // language Value. |
| class ValueGraphVisitor : public EffectGraphVisitor { |
| public: |
| - ValueGraphVisitor(FlowGraphBuilder* owner, intptr_t temp_index) |
| - : EffectGraphVisitor(owner, temp_index), value_(NULL) { } |
| + ValueGraphVisitor(FlowGraphBuilder* owner, |
| + intptr_t temp_index, |
| + intptr_t loop_depth) |
| + : EffectGraphVisitor(owner, temp_index, loop_depth), value_(NULL) { } |
| // Visit functions overridden by this class. |
| virtual void VisitLiteralNode(LiteralNode* node); |
| @@ -354,8 +363,9 @@ class TestGraphVisitor : public ValueGraphVisitor { |
| public: |
| TestGraphVisitor(FlowGraphBuilder* owner, |
| intptr_t temp_index, |
| + intptr_t loop_depth, |
| intptr_t condition_token_pos) |
| - : ValueGraphVisitor(owner, temp_index), |
| + : ValueGraphVisitor(owner, temp_index, loop_depth), |
| true_successor_addresses_(1), |
| false_successor_addresses_(1), |
| condition_token_pos_(condition_token_pos) { } |