| 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_INTERMEDIATE_LANGUAGE_H_ | 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ |
| 6 #define VM_INTERMEDIATE_LANGUAGE_H_ | 6 #define VM_INTERMEDIATE_LANGUAGE_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/ast.h" | 9 #include "vm/ast.h" |
| 10 #include "vm/growable_array.h" | 10 #include "vm/growable_array.h" |
| (...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 600 // graph entry with no predecessor. Joins are the only nodes with multiple | 600 // graph entry with no predecessor. Joins are the only nodes with multiple |
| 601 // predecessors. Targets are all other basic block entries. The types | 601 // predecessors. Targets are all other basic block entries. The types |
| 602 // enforce edge-split form---joins are forbidden as the successors of | 602 // enforce edge-split form---joins are forbidden as the successors of |
| 603 // branches. | 603 // branches. |
| 604 class BlockEntryInstr : public Instruction { | 604 class BlockEntryInstr : public Instruction { |
| 605 public: | 605 public: |
| 606 virtual BlockEntryInstr* AsBlockEntry() { return this; } | 606 virtual BlockEntryInstr* AsBlockEntry() { return this; } |
| 607 | 607 |
| 608 virtual intptr_t PredecessorCount() const = 0; | 608 virtual intptr_t PredecessorCount() const = 0; |
| 609 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const = 0; | 609 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const = 0; |
| 610 virtual void AddPredecessor(BlockEntryInstr* predecessor) = 0; |
| 610 virtual void PrepareEntry(FlowGraphCompiler* compiler) = 0; | 611 virtual void PrepareEntry(FlowGraphCompiler* compiler) = 0; |
| 611 | 612 |
| 612 intptr_t preorder_number() const { return preorder_number_; } | 613 intptr_t preorder_number() const { return preorder_number_; } |
| 613 void set_preorder_number(intptr_t number) { preorder_number_ = number; } | 614 void set_preorder_number(intptr_t number) { preorder_number_ = number; } |
| 614 | 615 |
| 615 intptr_t postorder_number() const { return postorder_number_; } | 616 intptr_t postorder_number() const { return postorder_number_; } |
| 616 void set_postorder_number(intptr_t number) { postorder_number_ = number; } | 617 void set_postorder_number(intptr_t number) { postorder_number_ = number; } |
| 617 | 618 |
| 618 intptr_t block_id() const { return block_id_; } | 619 intptr_t block_id() const { return block_id_; } |
| 619 void set_block_id(intptr_t value) { block_id_ = value; } | 620 void set_block_id(intptr_t value) { block_id_ = value; } |
| 620 | 621 |
| 621 void set_start_pos(intptr_t pos) { start_pos_ = pos; } | 622 void set_start_pos(intptr_t pos) { start_pos_ = pos; } |
| 622 intptr_t start_pos() const { return start_pos_; } | 623 intptr_t start_pos() const { return start_pos_; } |
| 623 void set_end_pos(intptr_t pos) { end_pos_ = pos; } | 624 void set_end_pos(intptr_t pos) { end_pos_ = pos; } |
| 624 intptr_t end_pos() const { return end_pos_; } | 625 intptr_t end_pos() const { return end_pos_; } |
| 625 | 626 |
| 626 BlockEntryInstr* dominator() const { return dominator_; } | 627 BlockEntryInstr* dominator() const { return dominator_; } |
| 627 void set_dominator(BlockEntryInstr* instr) { dominator_ = instr; } | 628 void set_dominator(BlockEntryInstr* instr) { dominator_ = instr; } |
| 628 | 629 |
| 629 const GrowableArray<BlockEntryInstr*>& dominated_blocks() { | 630 const GrowableArray<BlockEntryInstr*>& dominated_blocks() { |
| 630 return dominated_blocks_; | 631 return dominated_blocks_; |
| 631 } | 632 } |
| 632 | 633 |
| 633 void AddDominatedBlock(BlockEntryInstr* block) { | 634 void AddDominatedBlock(BlockEntryInstr* block) { |
| 634 dominated_blocks_.Add(block); | 635 dominated_blocks_.Add(block); |
| 635 } | 636 } |
| 636 void ClearDominatedBlocks() { dominated_blocks_.Clear(); } | |
| 637 | 637 |
| 638 bool Dominates(BlockEntryInstr* other) const; | 638 bool Dominates(BlockEntryInstr* other) const; |
| 639 | 639 |
| 640 Instruction* last_instruction() const { return last_instruction_; } | 640 Instruction* last_instruction() const { return last_instruction_; } |
| 641 void set_last_instruction(Instruction* instr) { last_instruction_ = instr; } | 641 void set_last_instruction(Instruction* instr) { last_instruction_ = instr; } |
| 642 | 642 |
| 643 ParallelMoveInstr* parallel_move() const { | 643 ParallelMoveInstr* parallel_move() const { |
| 644 return parallel_move_; | 644 return parallel_move_; |
| 645 } | 645 } |
| 646 | 646 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 preorder_number_(-1), | 690 preorder_number_(-1), |
| 691 postorder_number_(-1), | 691 postorder_number_(-1), |
| 692 block_id_(-1), | 692 block_id_(-1), |
| 693 dominator_(NULL), | 693 dominator_(NULL), |
| 694 dominated_blocks_(1), | 694 dominated_blocks_(1), |
| 695 last_instruction_(NULL), | 695 last_instruction_(NULL), |
| 696 parallel_move_(NULL), | 696 parallel_move_(NULL), |
| 697 loop_info_(NULL) { } | 697 loop_info_(NULL) { } |
| 698 | 698 |
| 699 private: | 699 private: |
| 700 virtual void ClearPredecessors() = 0; | |
| 701 virtual void AddPredecessor(BlockEntryInstr* predecessor) = 0; | |
| 702 | |
| 703 const intptr_t try_index_; | 700 const intptr_t try_index_; |
| 704 intptr_t preorder_number_; | 701 intptr_t preorder_number_; |
| 705 intptr_t postorder_number_; | 702 intptr_t postorder_number_; |
| 706 // Starting and ending lifetime positions for this block. Used by | 703 // Starting and ending lifetime positions for this block. Used by |
| 707 // the linear scan register allocator. | 704 // the linear scan register allocator. |
| 708 intptr_t block_id_; | 705 intptr_t block_id_; |
| 709 intptr_t start_pos_; | 706 intptr_t start_pos_; |
| 710 intptr_t end_pos_; | 707 intptr_t end_pos_; |
| 711 BlockEntryInstr* dominator_; // Immediate dominator, NULL for graph entry. | 708 BlockEntryInstr* dominator_; // Immediate dominator, NULL for graph entry. |
| 712 // TODO(fschneider): Optimize the case of one child to save space. | 709 // TODO(fschneider): Optimize the case of one child to save space. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 public: | 778 public: |
| 782 explicit GraphEntryInstr(TargetEntryInstr* normal_entry); | 779 explicit GraphEntryInstr(TargetEntryInstr* normal_entry); |
| 783 | 780 |
| 784 DECLARE_INSTRUCTION(GraphEntry) | 781 DECLARE_INSTRUCTION(GraphEntry) |
| 785 | 782 |
| 786 virtual intptr_t PredecessorCount() const { return 0; } | 783 virtual intptr_t PredecessorCount() const { return 0; } |
| 787 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 784 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 788 UNREACHABLE(); | 785 UNREACHABLE(); |
| 789 return NULL; | 786 return NULL; |
| 790 } | 787 } |
| 788 virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); } |
| 789 |
| 791 virtual intptr_t SuccessorCount() const; | 790 virtual intptr_t SuccessorCount() const; |
| 792 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; | 791 virtual BlockEntryInstr* SuccessorAt(intptr_t index) const; |
| 793 | 792 |
| 794 virtual void DiscoverBlocks( | 793 virtual void DiscoverBlocks( |
| 795 BlockEntryInstr* current_block, | 794 BlockEntryInstr* current_block, |
| 796 GrowableArray<BlockEntryInstr*>* preorder, | 795 GrowableArray<BlockEntryInstr*>* preorder, |
| 797 GrowableArray<BlockEntryInstr*>* postorder, | 796 GrowableArray<BlockEntryInstr*>* postorder, |
| 798 GrowableArray<intptr_t>* parent, | 797 GrowableArray<intptr_t>* parent, |
| 799 GrowableArray<BitVector*>* assigned_vars, | 798 GrowableArray<BitVector*>* assigned_vars, |
| 800 intptr_t variable_count, | 799 intptr_t variable_count, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 815 ASSERT(count >= 0); | 814 ASSERT(count >= 0); |
| 816 spill_slot_count_ = count; | 815 spill_slot_count_ = count; |
| 817 } | 816 } |
| 818 | 817 |
| 819 TargetEntryInstr* normal_entry() const { return normal_entry_; } | 818 TargetEntryInstr* normal_entry() const { return normal_entry_; } |
| 820 | 819 |
| 821 virtual void PrintTo(BufferFormatter* f) const; | 820 virtual void PrintTo(BufferFormatter* f) const; |
| 822 virtual void PrintToVisualizer(BufferFormatter* f) const; | 821 virtual void PrintToVisualizer(BufferFormatter* f) const; |
| 823 | 822 |
| 824 private: | 823 private: |
| 825 virtual void ClearPredecessors() { UNREACHABLE(); } | |
| 826 virtual void AddPredecessor(BlockEntryInstr* predecessor) { UNREACHABLE(); } | |
| 827 | |
| 828 TargetEntryInstr* normal_entry_; | 824 TargetEntryInstr* normal_entry_; |
| 829 GrowableArray<TargetEntryInstr*> catch_entries_; | 825 GrowableArray<TargetEntryInstr*> catch_entries_; |
| 830 Environment* start_env_; | 826 Environment* start_env_; |
| 831 ConstantInstr* constant_null_; | 827 ConstantInstr* constant_null_; |
| 832 intptr_t spill_slot_count_; | 828 intptr_t spill_slot_count_; |
| 833 | 829 |
| 834 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); | 830 DISALLOW_COPY_AND_ASSIGN(GraphEntryInstr); |
| 835 }; | 831 }; |
| 836 | 832 |
| 837 | 833 |
| 838 class JoinEntryInstr : public BlockEntryInstr { | 834 class JoinEntryInstr : public BlockEntryInstr { |
| 839 public: | 835 public: |
| 840 explicit JoinEntryInstr(intptr_t try_index) | 836 explicit JoinEntryInstr(intptr_t try_index) |
| 841 : BlockEntryInstr(try_index), | 837 : BlockEntryInstr(try_index), |
| 842 predecessors_(2), // Two is the assumed to be the common case. | 838 predecessors_(2), // Two is the assumed to be the common case. |
| 843 phis_(NULL), | 839 phis_(NULL), |
| 844 phi_count_(0) { } | 840 phi_count_(0) { } |
| 845 | 841 |
| 846 DECLARE_INSTRUCTION(JoinEntry) | 842 DECLARE_INSTRUCTION(JoinEntry) |
| 847 | 843 |
| 848 virtual intptr_t PredecessorCount() const { return predecessors_.length(); } | 844 virtual intptr_t PredecessorCount() const { return predecessors_.length(); } |
| 849 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 845 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 850 return predecessors_[index]; | 846 return predecessors_[index]; |
| 851 } | 847 } |
| 848 virtual void AddPredecessor(BlockEntryInstr* predecessor) { |
| 849 predecessors_.Add(predecessor); |
| 850 } |
| 852 | 851 |
| 853 // Returns -1 if pred is not in the list. | 852 // Returns -1 if pred is not in the list. |
| 854 intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const; | 853 intptr_t IndexOfPredecessor(BlockEntryInstr* pred) const; |
| 855 | 854 |
| 856 ZoneGrowableArray<PhiInstr*>* phis() const { return phis_; } | 855 ZoneGrowableArray<PhiInstr*>* phis() const { return phis_; } |
| 857 | 856 |
| 858 virtual void PrepareEntry(FlowGraphCompiler* compiler); | 857 virtual void PrepareEntry(FlowGraphCompiler* compiler); |
| 859 | 858 |
| 860 void InsertPhi(intptr_t var_index, intptr_t var_count); | 859 void InsertPhi(intptr_t var_index, intptr_t var_count); |
| 861 void RemoveDeadPhis(); | 860 void RemoveDeadPhis(); |
| 862 | 861 |
| 863 intptr_t phi_count() const { return phi_count_; } | 862 intptr_t phi_count() const { return phi_count_; } |
| 864 | 863 |
| 865 virtual void PrintTo(BufferFormatter* f) const; | 864 virtual void PrintTo(BufferFormatter* f) const; |
| 866 virtual void PrintToVisualizer(BufferFormatter* f) const; | 865 virtual void PrintToVisualizer(BufferFormatter* f) const; |
| 867 | 866 |
| 868 // After recomputing predecessors to eliminate unreachable ones, | |
| 869 // reorganize phi inputs to match the predecessor order and to eliminate | |
| 870 // unreachable inputs. | |
| 871 void EliminateUnreachablePhiInputs(); | |
| 872 | |
| 873 private: | 867 private: |
| 874 virtual void ClearPredecessors() { | |
| 875 // Keep a 'backup' of any existing predecessors to enable garbage | |
| 876 // collection of phis after eliminating unreachable code and recomputing | |
| 877 // predecessors. | |
| 878 stale_predecessors_.Clear(); | |
| 879 stale_predecessors_.AddArray(predecessors_); | |
| 880 predecessors_.Clear(); | |
| 881 } | |
| 882 virtual void AddPredecessor(BlockEntryInstr* predecessor) { | |
| 883 predecessors_.Add(predecessor); | |
| 884 } | |
| 885 | |
| 886 GrowableArray<BlockEntryInstr*> predecessors_; | 868 GrowableArray<BlockEntryInstr*> predecessors_; |
| 887 ZoneGrowableArray<PhiInstr*>* phis_; | 869 ZoneGrowableArray<PhiInstr*>* phis_; |
| 888 intptr_t phi_count_; | 870 intptr_t phi_count_; |
| 889 GrowableArray<BlockEntryInstr*> stale_predecessors_; | |
| 890 | 871 |
| 891 DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr); | 872 DISALLOW_COPY_AND_ASSIGN(JoinEntryInstr); |
| 892 }; | 873 }; |
| 893 | 874 |
| 894 | 875 |
| 895 class TargetEntryInstr : public BlockEntryInstr { | 876 class TargetEntryInstr : public BlockEntryInstr { |
| 896 public: | 877 public: |
| 897 explicit TargetEntryInstr(intptr_t try_index) | 878 explicit TargetEntryInstr(intptr_t try_index) |
| 898 : BlockEntryInstr(try_index), | 879 : BlockEntryInstr(try_index), |
| 899 predecessor_(NULL), | 880 predecessor_(NULL), |
| 900 catch_try_index_(CatchClauseNode::kInvalidTryIndex) { } | 881 catch_try_index_(CatchClauseNode::kInvalidTryIndex) { } |
| 901 | 882 |
| 902 // Used for exception catch entries. | 883 // Used for exception catch entries. |
| 903 TargetEntryInstr(intptr_t try_index, intptr_t catch_try_index) | 884 TargetEntryInstr(intptr_t try_index, intptr_t catch_try_index) |
| 904 : BlockEntryInstr(try_index), | 885 : BlockEntryInstr(try_index), |
| 905 predecessor_(NULL), | 886 predecessor_(NULL), |
| 906 catch_try_index_(catch_try_index) { } | 887 catch_try_index_(catch_try_index) { } |
| 907 | 888 |
| 908 DECLARE_INSTRUCTION(TargetEntry) | 889 DECLARE_INSTRUCTION(TargetEntry) |
| 909 | 890 |
| 910 virtual intptr_t PredecessorCount() const { | 891 virtual intptr_t PredecessorCount() const { |
| 911 return (predecessor_ == NULL) ? 0 : 1; | 892 return (predecessor_ == NULL) ? 0 : 1; |
| 912 } | 893 } |
| 913 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { | 894 virtual BlockEntryInstr* PredecessorAt(intptr_t index) const { |
| 914 ASSERT((index == 0) && (predecessor_ != NULL)); | 895 ASSERT((index == 0) && (predecessor_ != NULL)); |
| 915 return predecessor_; | 896 return predecessor_; |
| 916 } | 897 } |
| 898 virtual void AddPredecessor(BlockEntryInstr* predecessor) { |
| 899 ASSERT(predecessor_ == NULL); |
| 900 predecessor_ = predecessor; |
| 901 } |
| 917 | 902 |
| 918 // Returns true if this Block is an entry of a catch handler. | 903 // Returns true if this Block is an entry of a catch handler. |
| 919 bool IsCatchEntry() const { | 904 bool IsCatchEntry() const { |
| 920 return catch_try_index_ != CatchClauseNode::kInvalidTryIndex; | 905 return catch_try_index_ != CatchClauseNode::kInvalidTryIndex; |
| 921 } | 906 } |
| 922 | 907 |
| 923 // Returns try index for the try block to which this catch handler | 908 // Returns try index for the try block to which this catch handler |
| 924 // corresponds. | 909 // corresponds. |
| 925 intptr_t catch_try_index() const { | 910 intptr_t catch_try_index() const { |
| 926 ASSERT(IsCatchEntry()); | 911 ASSERT(IsCatchEntry()); |
| 927 return catch_try_index_; | 912 return catch_try_index_; |
| 928 } | 913 } |
| 929 | 914 |
| 930 virtual void PrepareEntry(FlowGraphCompiler* compiler); | 915 virtual void PrepareEntry(FlowGraphCompiler* compiler); |
| 931 | 916 |
| 932 virtual void PrintTo(BufferFormatter* f) const; | 917 virtual void PrintTo(BufferFormatter* f) const; |
| 933 virtual void PrintToVisualizer(BufferFormatter* f) const; | 918 virtual void PrintToVisualizer(BufferFormatter* f) const; |
| 934 | 919 |
| 935 private: | 920 private: |
| 936 virtual void ClearPredecessors() { predecessor_ = NULL; } | |
| 937 virtual void AddPredecessor(BlockEntryInstr* predecessor) { | |
| 938 ASSERT(predecessor_ == NULL); | |
| 939 predecessor_ = predecessor; | |
| 940 } | |
| 941 | |
| 942 BlockEntryInstr* predecessor_; | 921 BlockEntryInstr* predecessor_; |
| 943 const intptr_t catch_try_index_; | 922 const intptr_t catch_try_index_; |
| 944 | 923 |
| 945 DISALLOW_COPY_AND_ASSIGN(TargetEntryInstr); | 924 DISALLOW_COPY_AND_ASSIGN(TargetEntryInstr); |
| 946 }; | 925 }; |
| 947 | 926 |
| 948 | 927 |
| 949 // Abstract super-class of all instructions that define a value (Bind, Phi). | 928 // Abstract super-class of all instructions that define a value (Bind, Phi). |
| 950 class Definition : public Instruction { | 929 class Definition : public Instruction { |
| 951 public: | 930 public: |
| 952 enum UseKind { kEffect, kValue }; | 931 enum UseKind { kEffect, kValue }; |
| 953 | 932 |
| 954 Definition(); | 933 Definition() |
| 934 : temp_index_(-1), |
| 935 ssa_temp_index_(-1), |
| 936 propagated_type_(AbstractType::Handle()), |
| 937 propagated_cid_(kIllegalCid), |
| 938 input_use_list_(NULL), |
| 939 env_use_list_(NULL), |
| 940 use_kind_(kValue) { // Phis and parameters rely on this default. |
| 941 } |
| 955 | 942 |
| 956 virtual Definition* AsDefinition() { return this; } | 943 virtual Definition* AsDefinition() { return this; } |
| 957 | 944 |
| 958 bool IsComparison() { return (AsComparison() != NULL); } | 945 bool IsComparison() { return (AsComparison() != NULL); } |
| 959 virtual ComparisonInstr* AsComparison() { return NULL; } | 946 virtual ComparisonInstr* AsComparison() { return NULL; } |
| 960 | 947 |
| 961 // Overridden by definitions that push arguments. | 948 // Overridden by definitions that push arguments. |
| 962 virtual intptr_t ArgumentCount() const { return 0; } | 949 virtual intptr_t ArgumentCount() const { return 0; } |
| 963 | 950 |
| 964 intptr_t temp_index() const { return temp_index_; } | 951 intptr_t temp_index() const { return temp_index_; } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 | 1053 |
| 1067 // Get the block entry for that instruction. | 1054 // Get the block entry for that instruction. |
| 1068 virtual BlockEntryInstr* GetBlock() const; | 1055 virtual BlockEntryInstr* GetBlock() const; |
| 1069 | 1056 |
| 1070 // Printing support. These functions are sometimes overridden for custom | 1057 // Printing support. These functions are sometimes overridden for custom |
| 1071 // formatting. Otherwise, it prints in the format "opcode(op1, op2, op3)". | 1058 // formatting. Otherwise, it prints in the format "opcode(op1, op2, op3)". |
| 1072 virtual void PrintTo(BufferFormatter* f) const; | 1059 virtual void PrintTo(BufferFormatter* f) const; |
| 1073 virtual void PrintOperandsTo(BufferFormatter* f) const; | 1060 virtual void PrintOperandsTo(BufferFormatter* f) const; |
| 1074 virtual void PrintToVisualizer(BufferFormatter* f) const; | 1061 virtual void PrintToVisualizer(BufferFormatter* f) const; |
| 1075 | 1062 |
| 1076 // A value in the constant propagation lattice. | |
| 1077 // - non-constant sentinel | |
| 1078 // - a constant (any non-sentinel value) | |
| 1079 // - unknown sentinel | |
| 1080 Object& constant_value() const { return constant_value_; } | |
| 1081 | |
| 1082 private: | 1063 private: |
| 1083 intptr_t temp_index_; | 1064 intptr_t temp_index_; |
| 1084 intptr_t ssa_temp_index_; | 1065 intptr_t ssa_temp_index_; |
| 1085 // TODO(regis): GrowableArray<const AbstractType*> propagated_types_; | 1066 // TODO(regis): GrowableArray<const AbstractType*> propagated_types_; |
| 1086 // For now: | 1067 // For now: |
| 1087 AbstractType& propagated_type_; | 1068 AbstractType& propagated_type_; |
| 1088 intptr_t propagated_cid_; | 1069 intptr_t propagated_cid_; |
| 1089 Value* input_use_list_; | 1070 Value* input_use_list_; |
| 1090 Value* env_use_list_; | 1071 Value* env_use_list_; |
| 1091 UseKind use_kind_; | 1072 UseKind use_kind_; |
| 1092 | 1073 |
| 1093 Object& constant_value_; | |
| 1094 | |
| 1095 DISALLOW_COPY_AND_ASSIGN(Definition); | 1074 DISALLOW_COPY_AND_ASSIGN(Definition); |
| 1096 }; | 1075 }; |
| 1097 | 1076 |
| 1098 | 1077 |
| 1099 class PhiInstr : public Definition { | 1078 class PhiInstr : public Definition { |
| 1100 public: | 1079 public: |
| 1101 explicit PhiInstr(JoinEntryInstr* block, intptr_t num_inputs) | 1080 explicit PhiInstr(JoinEntryInstr* block, intptr_t num_inputs) |
| 1102 : block_(block), | 1081 : block_(block), |
| 1103 inputs_(num_inputs), | 1082 inputs_(num_inputs), |
| 1104 is_alive_(false), | 1083 is_alive_(false), |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1155 UNREACHABLE(); | 1134 UNREACHABLE(); |
| 1156 return kIllegalCid; | 1135 return kIllegalCid; |
| 1157 } | 1136 } |
| 1158 | 1137 |
| 1159 DECLARE_INSTRUCTION(Phi) | 1138 DECLARE_INSTRUCTION(Phi) |
| 1160 | 1139 |
| 1161 virtual void PrintTo(BufferFormatter* f) const; | 1140 virtual void PrintTo(BufferFormatter* f) const; |
| 1162 virtual void PrintToVisualizer(BufferFormatter* f) const; | 1141 virtual void PrintToVisualizer(BufferFormatter* f) const; |
| 1163 | 1142 |
| 1164 private: | 1143 private: |
| 1165 friend class JoinEntryInstr; // Direct access to inputs_ array. | |
| 1166 | |
| 1167 JoinEntryInstr* block_; | 1144 JoinEntryInstr* block_; |
| 1168 GrowableArray<Value*> inputs_; | 1145 GrowableArray<Value*> inputs_; |
| 1169 bool is_alive_; | 1146 bool is_alive_; |
| 1170 Representation representation_; | 1147 Representation representation_; |
| 1171 | 1148 |
| 1172 DISALLOW_COPY_AND_ASSIGN(PhiInstr); | 1149 DISALLOW_COPY_AND_ASSIGN(PhiInstr); |
| 1173 }; | 1150 }; |
| 1174 | 1151 |
| 1175 | 1152 |
| 1176 class ParameterInstr : public Definition { | 1153 class ParameterInstr : public Definition { |
| (...skipping 2487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3664 ForwardInstructionIterator* current_iterator_; | 3641 ForwardInstructionIterator* current_iterator_; |
| 3665 | 3642 |
| 3666 private: | 3643 private: |
| 3667 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); | 3644 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); |
| 3668 }; | 3645 }; |
| 3669 | 3646 |
| 3670 | 3647 |
| 3671 } // namespace dart | 3648 } // namespace dart |
| 3672 | 3649 |
| 3673 #endif // VM_INTERMEDIATE_LANGUAGE_H_ | 3650 #endif // VM_INTERMEDIATE_LANGUAGE_H_ |
| OLD | NEW |