| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 GrowableArray<Data> exits_; | 136 GrowableArray<Data> exits_; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 | 139 |
| 140 // Build a flow graph from a parsed function's AST. | 140 // Build a flow graph from a parsed function's AST. |
| 141 class FlowGraphBuilder: public ValueObject { | 141 class FlowGraphBuilder: public ValueObject { |
| 142 public: | 142 public: |
| 143 // The inlining context is NULL if not inlining. The osr_id is the deopt | 143 // The inlining context is NULL if not inlining. The osr_id is the deopt |
| 144 // id of the OSR entry or Isolate::kNoDeoptId if not compiling for OSR. | 144 // id of the OSR entry or Isolate::kNoDeoptId if not compiling for OSR. |
| 145 FlowGraphBuilder(ParsedFunction* parsed_function, | 145 FlowGraphBuilder(ParsedFunction* parsed_function, |
| 146 const Array& ic_data_array, | 146 const ZoneGrowableArray<const ICData*>& ic_data_array, |
| 147 InlineExitCollector* exit_collector, | 147 InlineExitCollector* exit_collector, |
| 148 intptr_t osr_id, | 148 intptr_t osr_id, |
| 149 bool is_optimizing); | 149 bool is_optimizing); |
| 150 | 150 |
| 151 FlowGraph* BuildGraph(); | 151 FlowGraph* BuildGraph(); |
| 152 | 152 |
| 153 ParsedFunction* parsed_function() const { return parsed_function_; } | 153 ParsedFunction* parsed_function() const { return parsed_function_; } |
| 154 const Array& ic_data_array() const { return ic_data_array_; } | 154 const ZoneGrowableArray<const ICData*>& ic_data_array() const { |
| 155 return ic_data_array_; |
| 156 } |
| 155 | 157 |
| 156 void WarnOnJSIntegralNumTypeTest(AstNode* node, | 158 void WarnOnJSIntegralNumTypeTest(AstNode* node, |
| 157 const AbstractType& type) const; | 159 const AbstractType& type) const; |
| 158 | 160 |
| 159 void Warning(intptr_t token_pos, const char* format, ...) const | 161 void Warning(intptr_t token_pos, const char* format, ...) const |
| 160 PRINTF_ATTRIBUTE(3, 4); | 162 PRINTF_ATTRIBUTE(3, 4); |
| 161 | 163 |
| 162 void Bailout(const char* reason) const; | 164 void Bailout(const char* reason) const; |
| 163 | 165 |
| 164 intptr_t AllocateBlockId() { return ++last_used_block_id_; } | 166 intptr_t AllocateBlockId() { return ++last_used_block_id_; } |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 friend class NestedStatement; // Explicit access to nesting_stack_. | 230 friend class NestedStatement; // Explicit access to nesting_stack_. |
| 229 | 231 |
| 230 intptr_t parameter_count() const { | 232 intptr_t parameter_count() const { |
| 231 return num_copied_params_ + num_non_copied_params_; | 233 return num_copied_params_ + num_non_copied_params_; |
| 232 } | 234 } |
| 233 intptr_t variable_count() const { | 235 intptr_t variable_count() const { |
| 234 return parameter_count() + num_stack_locals_; | 236 return parameter_count() + num_stack_locals_; |
| 235 } | 237 } |
| 236 | 238 |
| 237 ParsedFunction* parsed_function_; | 239 ParsedFunction* parsed_function_; |
| 238 const Array& ic_data_array_; | 240 const ZoneGrowableArray<const ICData*>& ic_data_array_; |
| 239 | 241 |
| 240 const intptr_t num_copied_params_; | 242 const intptr_t num_copied_params_; |
| 241 const intptr_t num_non_copied_params_; | 243 const intptr_t num_non_copied_params_; |
| 242 const intptr_t num_stack_locals_; // Does not include any parameters. | 244 const intptr_t num_stack_locals_; // Does not include any parameters. |
| 243 InlineExitCollector* const exit_collector_; | 245 InlineExitCollector* const exit_collector_; |
| 244 ZoneGrowableArray<const Field*>* guarded_fields_; | 246 ZoneGrowableArray<const Field*>* guarded_fields_; |
| 245 | 247 |
| 246 intptr_t last_used_block_id_; | 248 intptr_t last_used_block_id_; |
| 247 intptr_t try_index_; | 249 intptr_t try_index_; |
| 248 intptr_t catch_try_index_; | 250 intptr_t catch_try_index_; |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 // Output parameters. | 588 // Output parameters. |
| 587 GrowableArray<TargetEntryInstr**> true_successor_addresses_; | 589 GrowableArray<TargetEntryInstr**> true_successor_addresses_; |
| 588 GrowableArray<TargetEntryInstr**> false_successor_addresses_; | 590 GrowableArray<TargetEntryInstr**> false_successor_addresses_; |
| 589 | 591 |
| 590 intptr_t condition_token_pos_; | 592 intptr_t condition_token_pos_; |
| 591 }; | 593 }; |
| 592 | 594 |
| 593 } // namespace dart | 595 } // namespace dart |
| 594 | 596 |
| 595 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 597 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |