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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 NestedStatement* nesting_stack() const { return nesting_stack_; } | 212 NestedStatement* nesting_stack() const { return nesting_stack_; } |
213 | 213 |
214 // When compiling for OSR, remove blocks that are not reachable from the | 214 // When compiling for OSR, remove blocks that are not reachable from the |
215 // OSR entry point. | 215 // OSR entry point. |
216 void PruneUnreachable(); | 216 void PruneUnreachable(); |
217 | 217 |
218 // Returns address where the constant 'value' is stored or 0 if not found. | 218 // Returns address where the constant 'value' is stored or 0 if not found. |
219 static uword FindDoubleConstant(double value); | 219 static uword FindDoubleConstant(double value); |
220 | 220 |
| 221 Isolate* isolate() const { return parsed_function()->isolate(); } |
| 222 |
221 private: | 223 private: |
222 friend class NestedStatement; // Explicit access to nesting_stack_. | 224 friend class NestedStatement; // Explicit access to nesting_stack_. |
223 | 225 |
224 intptr_t parameter_count() const { | 226 intptr_t parameter_count() const { |
225 return num_copied_params_ + num_non_copied_params_; | 227 return num_copied_params_ + num_non_copied_params_; |
226 } | 228 } |
227 intptr_t variable_count() const { | 229 intptr_t variable_count() const { |
228 return parameter_count() + num_stack_locals_; | 230 return parameter_count() + num_stack_locals_; |
229 } | 231 } |
230 | 232 |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 const AbstractType& dst_type, | 444 const AbstractType& dst_type, |
443 const String& dst_name); | 445 const String& dst_name); |
444 | 446 |
445 // Helpers for allocating and deallocating temporary locals on top of the | 447 // Helpers for allocating and deallocating temporary locals on top of the |
446 // expression stack. | 448 // expression stack. |
447 LocalVariable* EnterTempLocalScope(Value* value); | 449 LocalVariable* EnterTempLocalScope(Value* value); |
448 Definition* ExitTempLocalScope(LocalVariable* var); | 450 Definition* ExitTempLocalScope(LocalVariable* var); |
449 | 451 |
450 void BuildLetTempExpressions(LetNode* node); | 452 void BuildLetTempExpressions(LetNode* node); |
451 | 453 |
| 454 Isolate* isolate() const { return owner()->isolate(); } |
| 455 |
452 private: | 456 private: |
453 friend class TempLocalScope; // For ReturnDefinition. | 457 friend class TempLocalScope; // For ReturnDefinition. |
454 | 458 |
455 // Helper to drop the result value. | 459 // Helper to drop the result value. |
456 virtual void ReturnValue(Value* value) { | 460 virtual void ReturnValue(Value* value) { |
457 Do(new DropTempsInstr(0, value)); | 461 Do(new DropTempsInstr(0, value)); |
458 } | 462 } |
459 | 463 |
460 // Specify a definition of the final result. Adds the definition to | 464 // Specify a definition of the final result. Adds the definition to |
461 // the graph, but normally overridden in subclasses. | 465 // the graph, but normally overridden in subclasses. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 // Output parameters. | 582 // Output parameters. |
579 GrowableArray<TargetEntryInstr**> true_successor_addresses_; | 583 GrowableArray<TargetEntryInstr**> true_successor_addresses_; |
580 GrowableArray<TargetEntryInstr**> false_successor_addresses_; | 584 GrowableArray<TargetEntryInstr**> false_successor_addresses_; |
581 | 585 |
582 intptr_t condition_token_pos_; | 586 intptr_t condition_token_pos_; |
583 }; | 587 }; |
584 | 588 |
585 } // namespace dart | 589 } // namespace dart |
586 | 590 |
587 #endif // VM_FLOW_GRAPH_BUILDER_H_ | 591 #endif // VM_FLOW_GRAPH_BUILDER_H_ |
OLD | NEW |