| 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 RUNTIME_VM_FLOW_GRAPH_BUILDER_H_ | 5 #ifndef RUNTIME_VM_FLOW_GRAPH_BUILDER_H_ |
| 6 #define RUNTIME_VM_FLOW_GRAPH_BUILDER_H_ | 6 #define RUNTIME_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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // OSR entry point. | 165 // OSR entry point. |
| 166 void PruneUnreachable(); | 166 void PruneUnreachable(); |
| 167 | 167 |
| 168 // Returns address where the constant 'value' is stored or 0 if not found. | 168 // Returns address where the constant 'value' is stored or 0 if not found. |
| 169 static uword FindDoubleConstant(double value); | 169 static uword FindDoubleConstant(double value); |
| 170 | 170 |
| 171 Thread* thread() const { return parsed_function().thread(); } | 171 Thread* thread() const { return parsed_function().thread(); } |
| 172 Isolate* isolate() const { return parsed_function().isolate(); } | 172 Isolate* isolate() const { return parsed_function().isolate(); } |
| 173 Zone* zone() const { return parsed_function().zone(); } | 173 Zone* zone() const { return parsed_function().zone(); } |
| 174 | 174 |
| 175 void AppendAwaitTokenPosition(TokenPosition token_pos); |
| 176 |
| 177 ZoneGrowableArray<TokenPosition>* await_token_positions() const { |
| 178 return await_token_positions_; |
| 179 } |
| 180 |
| 175 private: | 181 private: |
| 176 friend class NestedStatement; // Explicit access to nesting_stack_. | 182 friend class NestedStatement; // Explicit access to nesting_stack_. |
| 177 friend class Intrinsifier; | 183 friend class Intrinsifier; |
| 178 | 184 |
| 179 intptr_t parameter_count() const { | 185 intptr_t parameter_count() const { |
| 180 return num_copied_params_ + num_non_copied_params_; | 186 return num_copied_params_ + num_non_copied_params_; |
| 181 } | 187 } |
| 182 intptr_t variable_count() const { | 188 intptr_t variable_count() const { |
| 183 return parameter_count() + num_stack_locals_; | 189 return parameter_count() + num_stack_locals_; |
| 184 } | 190 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 205 | 211 |
| 206 // A stack of enclosing nested statements. | 212 // A stack of enclosing nested statements. |
| 207 NestedStatement* nesting_stack_; | 213 NestedStatement* nesting_stack_; |
| 208 | 214 |
| 209 // The deopt id of the OSR entry orCompiler::kNoOSRDeoptId if not compiling | 215 // The deopt id of the OSR entry orCompiler::kNoOSRDeoptId if not compiling |
| 210 // for OSR. | 216 // for OSR. |
| 211 const intptr_t osr_id_; | 217 const intptr_t osr_id_; |
| 212 | 218 |
| 213 intptr_t jump_count_; | 219 intptr_t jump_count_; |
| 214 ZoneGrowableArray<JoinEntryInstr*>* await_joins_; | 220 ZoneGrowableArray<JoinEntryInstr*>* await_joins_; |
| 221 ZoneGrowableArray<TokenPosition>* await_token_positions_; |
| 215 | 222 |
| 216 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder); | 223 DISALLOW_IMPLICIT_CONSTRUCTORS(FlowGraphBuilder); |
| 217 }; | 224 }; |
| 218 | 225 |
| 219 | 226 |
| 220 // Translate an AstNode to a control-flow graph fragment for its effects | 227 // Translate an AstNode to a control-flow graph fragment for its effects |
| 221 // (e.g., a statement or an expression in an effect context). Implements a | 228 // (e.g., a statement or an expression in an effect context). Implements a |
| 222 // function from an AstNode and next temporary index to a graph fragment | 229 // function from an AstNode and next temporary index to a graph fragment |
| 223 // with a single entry and at most one exit. The fragment is represented by | 230 // with a single entry and at most one exit. The fragment is represented by |
| 224 // an (entry, exit) pair of Instruction pointers: | 231 // an (entry, exit) pair of Instruction pointers: |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 // Output parameters. | 563 // Output parameters. |
| 557 GrowableArray<TargetEntryInstr**> true_successor_addresses_; | 564 GrowableArray<TargetEntryInstr**> true_successor_addresses_; |
| 558 GrowableArray<TargetEntryInstr**> false_successor_addresses_; | 565 GrowableArray<TargetEntryInstr**> false_successor_addresses_; |
| 559 | 566 |
| 560 TokenPosition condition_token_pos_; | 567 TokenPosition condition_token_pos_; |
| 561 }; | 568 }; |
| 562 | 569 |
| 563 } // namespace dart | 570 } // namespace dart |
| 564 | 571 |
| 565 #endif // RUNTIME_VM_FLOW_GRAPH_BUILDER_H_ | 572 #endif // RUNTIME_VM_FLOW_GRAPH_BUILDER_H_ |
| OLD | NEW |