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