| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_ | 5 #ifndef VM_FLOW_GRAPH_BUILDER_H_ |
| 6 #define VM_FLOW_GRAPH_BUILDER_H_ | 6 #define VM_FLOW_GRAPH_BUILDER_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/globals.h" | 9 #include "platform/globals.h" |
| 10 #include "vm/allocation.h" | 10 #include "vm/allocation.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 intptr_t loop_depth() const { return loop_depth_; } | 171 intptr_t loop_depth() const { return loop_depth_; } |
| 172 | 172 |
| 173 // Manage the currently active try index. | 173 // Manage the currently active try index. |
| 174 void set_try_index(intptr_t value) { try_index_ = value; } | 174 void set_try_index(intptr_t value) { try_index_ = value; } |
| 175 intptr_t try_index() const { return try_index_; } | 175 intptr_t try_index() const { return try_index_; } |
| 176 | 176 |
| 177 // Manage the currently active catch-handler try index. | 177 // Manage the currently active catch-handler try index. |
| 178 void set_catch_try_index(intptr_t value) { catch_try_index_ = value; } | 178 void set_catch_try_index(intptr_t value) { catch_try_index_ = value; } |
| 179 intptr_t catch_try_index() const { return catch_try_index_; } | 179 intptr_t catch_try_index() const { return catch_try_index_; } |
| 180 | 180 |
| 181 intptr_t next_await_counter() { return jump_cnt_++; } | 181 intptr_t next_await_counter() { |
| 182 | 182 return graph_entry_->next_await_counter(); |
| 183 ZoneGrowableArray<intptr_t>* await_levels() const { return await_levels_; } | 183 } |
| 184 ZoneGrowableArray<JoinEntryInstr*>* await_joins() const { | 184 ZoneGrowableArray<intptr_t>& await_levels() const { |
| 185 return await_joins_; | 185 return graph_entry_->await_levels(); |
| 186 } |
| 187 ZoneGrowableArray<JoinEntryInstr*>& await_joins() const { |
| 188 return graph_entry_->await_joins(); |
| 186 } | 189 } |
| 187 | 190 |
| 188 void AddCatchEntry(CatchBlockEntryInstr* entry); | 191 void AddCatchEntry(CatchBlockEntryInstr* entry); |
| 189 | 192 |
| 190 intptr_t num_copied_params() const { | 193 intptr_t num_copied_params() const { |
| 191 return num_copied_params_; | 194 return num_copied_params_; |
| 192 } | 195 } |
| 193 intptr_t num_non_copied_params() const { | 196 intptr_t num_non_copied_params() const { |
| 194 return num_non_copied_params_; | 197 return num_non_copied_params_; |
| 195 } | 198 } |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // Outgoing argument stack height. | 264 // Outgoing argument stack height. |
| 262 intptr_t args_pushed_; | 265 intptr_t args_pushed_; |
| 263 | 266 |
| 264 // A stack of enclosing nested statements. | 267 // A stack of enclosing nested statements. |
| 265 NestedStatement* nesting_stack_; | 268 NestedStatement* nesting_stack_; |
| 266 | 269 |
| 267 // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling | 270 // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling |
| 268 // for OSR. | 271 // for OSR. |
| 269 const intptr_t osr_id_; | 272 const intptr_t osr_id_; |
| 270 | 273 |
| 271 intptr_t jump_cnt_; | |
| 272 ZoneGrowableArray<JoinEntryInstr*>* await_joins_; | |
| 273 ZoneGrowableArray<intptr_t>* await_levels_; | |
| 274 | |
| 275 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder); | 274 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder); |
| 276 }; | 275 }; |
| 277 | 276 |
| 278 | 277 |
| 279 // Translate an AstNode to a control-flow graph fragment for its effects | 278 // Translate an AstNode to a control-flow graph fragment for its effects |
| 280 // (e.g., a statement or an expression in an effect context). Implements a | 279 // (e.g., a statement or an expression in an effect context). Implements a |
| 281 // function from an AstNode and next temporary index to a graph fragment | 280 // function from an AstNode and next temporary index to a graph fragment |
| 282 // with a single entry and at most one exit. The fragment is represented by | 281 // with a single entry and at most one exit. The fragment is represented by |
| 283 // an (entry, exit) pair of Instruction pointers: | 282 // an (entry, exit) pair of Instruction pointers: |
| 284 // | 283 // |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 // Output parameters. | 597 // Output parameters. |
| 599 GrowableArray<TargetEntryInstr**> true_successor_addresses_; | 598 GrowableArray<TargetEntryInstr**> true_successor_addresses_; |
| 600 GrowableArray<TargetEntryInstr**> false_successor_addresses_; | 599 GrowableArray<TargetEntryInstr**> false_successor_addresses_; |
| 601 | 600 |
| 602 intptr_t condition_token_pos_; | 601 intptr_t condition_token_pos_; |
| 603 }; | 602 }; |
| 604 | 603 |
| 605 } // namespace dart | 604 } // namespace dart |
| 606 | 605 |
| 607 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 606 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |