| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 | 656 |
| 657 #if defined(DEBUG) | 657 #if defined(DEBUG) |
| 658 void FrameStateUpdateWith(Instruction* instr); | 658 void FrameStateUpdateWith(Instruction* instr); |
| 659 void FrameStatePush(Definition* defn); | 659 void FrameStatePush(Definition* defn); |
| 660 void FrameStatePop(intptr_t count); | 660 void FrameStatePop(intptr_t count); |
| 661 bool FrameStateIsSafeToCall(); | 661 bool FrameStateIsSafeToCall(); |
| 662 void FrameStateClear(); | 662 void FrameStateClear(); |
| 663 #endif | 663 #endif |
| 664 | 664 |
| 665 // This struct contains either function or code, the other one being NULL. | 665 // This struct contains either function or code, the other one being NULL. |
| 666 struct StaticCallsStruct { | 666 class StaticCallsStruct : public ZoneAllocated { |
| 667 intptr_t offset; | 667 public: |
| 668 const intptr_t offset; |
| 668 const Function* function; // Can be NULL. | 669 const Function* function; // Can be NULL. |
| 669 const Code* code; // Can be NULL. | 670 const Code* code; // Can be NULL. |
| 670 StaticCallsStruct(intptr_t offset_arg, | 671 StaticCallsStruct(intptr_t offset_arg, |
| 671 const Function* function_arg, | 672 const Function* function_arg, |
| 672 const Code* code_arg) | 673 const Code* code_arg) |
| 673 : offset(offset_arg), function(function_arg), code(code_arg) {} | 674 : offset(offset_arg), function(function_arg), code(code_arg) { |
| 675 ASSERT((function == NULL) || function->IsZoneHandle()); |
| 676 ASSERT((code == NULL) || code->IsZoneHandle()); |
| 677 } |
| 678 |
| 679 private: |
| 680 DISALLOW_COPY_AND_ASSIGN(StaticCallsStruct); |
| 674 }; | 681 }; |
| 675 | 682 |
| 676 Isolate* isolate_; | 683 Isolate* isolate_; |
| 677 Zone* zone_; | 684 Zone* zone_; |
| 678 Assembler* assembler_; | 685 Assembler* assembler_; |
| 679 const ParsedFunction& parsed_function_; | 686 const ParsedFunction& parsed_function_; |
| 680 const FlowGraph& flow_graph_; | 687 const FlowGraph& flow_graph_; |
| 681 const GrowableArray<BlockEntryInstr*>& block_order_; | 688 const GrowableArray<BlockEntryInstr*>& block_order_; |
| 682 | 689 |
| 683 #if defined(DEBUG) | 690 #if defined(DEBUG) |
| 684 GrowableArray<Representation> frame_state_; | 691 GrowableArray<Representation> frame_state_; |
| 685 #endif | 692 #endif |
| 686 | 693 |
| 687 // Compiler specific per-block state. Indexed by postorder block number | 694 // Compiler specific per-block state. Indexed by postorder block number |
| 688 // for convenience. This is not the block's index in the block order, | 695 // for convenience. This is not the block's index in the block order, |
| 689 // which is reverse postorder. | 696 // which is reverse postorder. |
| 690 BlockEntryInstr* current_block_; | 697 BlockEntryInstr* current_block_; |
| 691 ExceptionHandlerList* exception_handlers_list_; | 698 ExceptionHandlerList* exception_handlers_list_; |
| 692 DescriptorList* pc_descriptors_list_; | 699 DescriptorList* pc_descriptors_list_; |
| 693 StackmapTableBuilder* stackmap_table_builder_; | 700 StackmapTableBuilder* stackmap_table_builder_; |
| 694 GrowableArray<BlockInfo*> block_info_; | 701 GrowableArray<BlockInfo*> block_info_; |
| 695 GrowableArray<CompilerDeoptInfo*> deopt_infos_; | 702 GrowableArray<CompilerDeoptInfo*> deopt_infos_; |
| 696 GrowableArray<SlowPathCode*> slow_path_code_; | 703 GrowableArray<SlowPathCode*> slow_path_code_; |
| 697 // Stores static call targets as well as stub targets. | 704 // Stores static call targets as well as stub targets. |
| 698 // TODO(srdjan): Evaluate if we should store allocation stub targets into a | 705 // TODO(srdjan): Evaluate if we should store allocation stub targets into a |
| 699 // separate table? | 706 // separate table? |
| 700 GrowableArray<StaticCallsStruct> static_calls_target_table_; | 707 GrowableArray<StaticCallsStruct*> static_calls_target_table_; |
| 701 const bool is_optimizing_; | 708 const bool is_optimizing_; |
| 702 // Set to true if optimized code has IC calls. | 709 // Set to true if optimized code has IC calls. |
| 703 bool may_reoptimize_; | 710 bool may_reoptimize_; |
| 704 // True while emitting intrinsic code. | 711 // True while emitting intrinsic code. |
| 705 bool intrinsic_mode_; | 712 bool intrinsic_mode_; |
| 706 Label intrinsic_slow_path_label_; | 713 Label intrinsic_slow_path_label_; |
| 707 | 714 |
| 708 const Class& double_class_; | 715 const Class& double_class_; |
| 709 const Class& mint_class_; | 716 const Class& mint_class_; |
| 710 const Class& float32x4_class_; | 717 const Class& float32x4_class_; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 729 Array& inlined_code_intervals_; | 736 Array& inlined_code_intervals_; |
| 730 const GrowableArray<const Function*>& inline_id_to_function_; | 737 const GrowableArray<const Function*>& inline_id_to_function_; |
| 731 const GrowableArray<intptr_t>& caller_inline_id_; | 738 const GrowableArray<intptr_t>& caller_inline_id_; |
| 732 | 739 |
| 733 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); | 740 DISALLOW_COPY_AND_ASSIGN(FlowGraphCompiler); |
| 734 }; | 741 }; |
| 735 | 742 |
| 736 } // namespace dart | 743 } // namespace dart |
| 737 | 744 |
| 738 #endif // VM_FLOW_GRAPH_COMPILER_H_ | 745 #endif // VM_FLOW_GRAPH_COMPILER_H_ |
| OLD | NEW |