| 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_COMPILER_H_ | 5 #ifndef VM_FLOW_GRAPH_COMPILER_H_ |
| 6 #define VM_FLOW_GRAPH_COMPILER_H_ | 6 #define VM_FLOW_GRAPH_COMPILER_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/assembler.h" | 9 #include "vm/assembler.h" |
| 10 #include "vm/code_descriptors.h" | 10 #include "vm/code_descriptors.h" |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 // Map a block number in a forward iteration into the block number in the | 556 // Map a block number in a forward iteration into the block number in the |
| 557 // corresponding reverse iteration. Used to obtain an index into | 557 // corresponding reverse iteration. Used to obtain an index into |
| 558 // block_order for reverse iterations. | 558 // block_order for reverse iterations. |
| 559 intptr_t reverse_index(intptr_t index) const { | 559 intptr_t reverse_index(intptr_t index) const { |
| 560 return block_order_.length() - index - 1; | 560 return block_order_.length() - index - 1; |
| 561 } | 561 } |
| 562 | 562 |
| 563 void CompactBlock(BlockEntryInstr* block); | 563 void CompactBlock(BlockEntryInstr* block); |
| 564 void CompactBlocks(); | 564 void CompactBlocks(); |
| 565 | 565 |
| 566 bool IsListClass(const Class& cls) const { |
| 567 return cls.raw() == list_class_.raw(); |
| 568 } |
| 569 |
| 566 class Assembler* assembler_; | 570 class Assembler* assembler_; |
| 567 const ParsedFunction& parsed_function_; | 571 const ParsedFunction& parsed_function_; |
| 568 const FlowGraph& flow_graph_; | 572 const FlowGraph& flow_graph_; |
| 569 const GrowableArray<BlockEntryInstr*>& block_order_; | 573 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 570 | 574 |
| 571 // Compiler specific per-block state. Indexed by postorder block number | 575 // Compiler specific per-block state. Indexed by postorder block number |
| 572 // for convenience. This is not the block's index in the block order, | 576 // for convenience. This is not the block's index in the block order, |
| 573 // which is reverse postorder. | 577 // which is reverse postorder. |
| 574 BlockEntryInstr* current_block_; | 578 BlockEntryInstr* current_block_; |
| 575 ExceptionHandlerList* exception_handlers_list_; | 579 ExceptionHandlerList* exception_handlers_list_; |
| 576 DescriptorList* pc_descriptors_list_; | 580 DescriptorList* pc_descriptors_list_; |
| 577 StackmapTableBuilder* stackmap_table_builder_; | 581 StackmapTableBuilder* stackmap_table_builder_; |
| 578 GrowableArray<BlockInfo*> block_info_; | 582 GrowableArray<BlockInfo*> block_info_; |
| 579 GrowableArray<CompilerDeoptInfo*> deopt_infos_; | 583 GrowableArray<CompilerDeoptInfo*> deopt_infos_; |
| 580 GrowableArray<SlowPathCode*> slow_path_code_; | 584 GrowableArray<SlowPathCode*> slow_path_code_; |
| 581 // Stores: [code offset, function, null(code)]. | 585 // Stores: [code offset, function, null(code)]. |
| 582 const GrowableObjectArray& static_calls_target_table_; | 586 const GrowableObjectArray& static_calls_target_table_; |
| 583 const bool is_optimizing_; | 587 const bool is_optimizing_; |
| 584 // Set to true if optimized code has IC calls. | 588 // Set to true if optimized code has IC calls. |
| 585 bool may_reoptimize_; | 589 bool may_reoptimize_; |
| 586 | 590 |
| 587 const Class& double_class_; | 591 const Class& double_class_; |
| 588 const Class& float32x4_class_; | 592 const Class& float32x4_class_; |
| 589 const Class& uint32x4_class_; | 593 const Class& uint32x4_class_; |
| 594 const Class& list_class_; |
| 590 | 595 |
| 591 ParallelMoveResolver parallel_move_resolver_; | 596 ParallelMoveResolver parallel_move_resolver_; |
| 592 | 597 |
| 593 // Currently instructions generate deopt stubs internally by | 598 // Currently instructions generate deopt stubs internally by |
| 594 // calling AddDeoptStub. To communicate deoptimization environment | 599 // calling AddDeoptStub. To communicate deoptimization environment |
| 595 // that should be used when deoptimizing we store it in this variable. | 600 // that should be used when deoptimizing we store it in this variable. |
| 596 // In future AddDeoptStub should be moved out of the instruction template. | 601 // In future AddDeoptStub should be moved out of the instruction template. |
| 597 Environment* pending_deoptimization_env_; | 602 Environment* pending_deoptimization_env_; |
| 598 | 603 |
| 599 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 604 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
| 600 }; | 605 }; |
| 601 | 606 |
| 602 } // namespace dart | 607 } // namespace dart |
| 603 | 608 |
| 604 #endif // VM_FLOW_GRAPH_COMPILER_H_ | 609 #endif // VM_FLOW_GRAPH_COMPILER_H_ |
| OLD | NEW |