| 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 "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 intptr_t AllocateBlockId() { return ++last_used_block_id_; } | 117 intptr_t AllocateBlockId() { return ++last_used_block_id_; } |
| 118 void SetInitialBlockId(intptr_t id) { last_used_block_id_ = id; } | 118 void SetInitialBlockId(intptr_t id) { last_used_block_id_ = id; } |
| 119 | 119 |
| 120 void set_context_level(intptr_t value) { context_level_ = value; } | 120 void set_context_level(intptr_t value) { context_level_ = value; } |
| 121 intptr_t context_level() const { return context_level_; } | 121 intptr_t context_level() const { return context_level_; } |
| 122 | 122 |
| 123 void IncrementLoopDepth() { ++loop_depth_; } | 123 void IncrementLoopDepth() { ++loop_depth_; } |
| 124 void DecrementLoopDepth() { --loop_depth_; } | 124 void DecrementLoopDepth() { --loop_depth_; } |
| 125 intptr_t loop_depth() const { return loop_depth_; } | 125 intptr_t loop_depth() const { return loop_depth_; } |
| 126 | 126 |
| 127 // Each try in this function gets its own try index. | |
| 128 intptr_t AllocateTryIndex() { return ++last_used_try_index_; } | |
| 129 | |
| 130 // Manage the currently active try index. | 127 // Manage the currently active try index. |
| 131 void set_try_index(intptr_t value) { try_index_ = value; } | 128 void set_try_index(intptr_t value) { try_index_ = value; } |
| 132 intptr_t try_index() const { return try_index_; } | 129 intptr_t try_index() const { return try_index_; } |
| 133 | 130 |
| 134 void AddCatchEntry(CatchBlockEntryInstr* entry); | 131 void AddCatchEntry(CatchBlockEntryInstr* entry); |
| 135 | 132 |
| 136 intptr_t num_copied_params() const { | 133 intptr_t num_copied_params() const { |
| 137 return num_copied_params_; | 134 return num_copied_params_; |
| 138 } | 135 } |
| 139 intptr_t num_non_copied_params() const { | 136 intptr_t num_non_copied_params() const { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 164 ParsedFunction* parsed_function_; | 161 ParsedFunction* parsed_function_; |
| 165 const Array& ic_data_array_; | 162 const Array& ic_data_array_; |
| 166 | 163 |
| 167 const intptr_t num_copied_params_; | 164 const intptr_t num_copied_params_; |
| 168 const intptr_t num_non_copied_params_; | 165 const intptr_t num_non_copied_params_; |
| 169 const intptr_t num_stack_locals_; // Does not include any parameters. | 166 const intptr_t num_stack_locals_; // Does not include any parameters. |
| 170 InlineExitCollector* const exit_collector_; | 167 InlineExitCollector* const exit_collector_; |
| 171 | 168 |
| 172 intptr_t last_used_block_id_; | 169 intptr_t last_used_block_id_; |
| 173 intptr_t context_level_; | 170 intptr_t context_level_; |
| 174 intptr_t last_used_try_index_; | |
| 175 intptr_t try_index_; | 171 intptr_t try_index_; |
| 176 intptr_t loop_depth_; | 172 intptr_t loop_depth_; |
| 177 GraphEntryInstr* graph_entry_; | 173 GraphEntryInstr* graph_entry_; |
| 178 | 174 |
| 179 // Outgoing argument stack height. | 175 // Outgoing argument stack height. |
| 180 intptr_t args_pushed_; | 176 intptr_t args_pushed_; |
| 181 | 177 |
| 182 // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling | 178 // The deopt id of the OSR entry or Isolate::kNoDeoptId if not compiling |
| 183 // for OSR. | 179 // for OSR. |
| 184 const intptr_t osr_id_; | 180 const intptr_t osr_id_; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 // Output parameters. | 513 // Output parameters. |
| 518 GrowableArray<TargetEntryInstr**> true_successor_addresses_; | 514 GrowableArray<TargetEntryInstr**> true_successor_addresses_; |
| 519 GrowableArray<TargetEntryInstr**> false_successor_addresses_; | 515 GrowableArray<TargetEntryInstr**> false_successor_addresses_; |
| 520 | 516 |
| 521 intptr_t condition_token_pos_; | 517 intptr_t condition_token_pos_; |
| 522 }; | 518 }; |
| 523 | 519 |
| 524 } // namespace dart | 520 } // namespace dart |
| 525 | 521 |
| 526 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 522 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |