OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 } | 771 } |
772 bool IsValid() const { return index_ >= 0; } | 772 bool IsValid() const { return index_ >= 0; } |
773 static RpoNumber FromInt(int index) { return RpoNumber(index); } | 773 static RpoNumber FromInt(int index) { return RpoNumber(index); } |
774 static RpoNumber Invalid() { return RpoNumber(kInvalidRpoNumber); } | 774 static RpoNumber Invalid() { return RpoNumber(kInvalidRpoNumber); } |
775 | 775 |
776 bool IsNext(const RpoNumber other) const { | 776 bool IsNext(const RpoNumber other) const { |
777 DCHECK(IsValid()); | 777 DCHECK(IsValid()); |
778 return other.index_ == this->index_ + 1; | 778 return other.index_ == this->index_ + 1; |
779 } | 779 } |
780 | 780 |
781 bool operator==(RpoNumber other) const { | 781 // Comparison operators. |
782 return this->index_ == other.index_; | 782 bool operator==(RpoNumber other) const { return index_ == other.index_; } |
783 } | 783 bool operator!=(RpoNumber other) const { return index_ != other.index_; } |
| 784 bool operator>(RpoNumber other) const { return index_ > other.index_; } |
| 785 bool operator<(RpoNumber other) const { return index_ < other.index_; } |
| 786 bool operator<=(RpoNumber other) const { return index_ <= other.index_; } |
| 787 bool operator>=(RpoNumber other) const { return index_ >= other.index_; } |
784 | 788 |
785 private: | 789 private: |
786 explicit RpoNumber(int32_t index) : index_(index) {} | 790 explicit RpoNumber(int32_t index) : index_(index) {} |
787 int32_t index_; | 791 int32_t index_; |
788 }; | 792 }; |
789 | 793 |
790 | 794 |
791 std::ostream& operator<<(std::ostream&, const RpoNumber&); | 795 std::ostream& operator<<(std::ostream&, const RpoNumber&); |
792 | 796 |
793 | 797 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 989 |
986 bool needs_frame() const { return needs_frame_; } | 990 bool needs_frame() const { return needs_frame_; } |
987 void mark_needs_frame() { needs_frame_ = true; } | 991 void mark_needs_frame() { needs_frame_ = true; } |
988 | 992 |
989 bool must_construct_frame() const { return must_construct_frame_; } | 993 bool must_construct_frame() const { return must_construct_frame_; } |
990 void mark_must_construct_frame() { must_construct_frame_ = true; } | 994 void mark_must_construct_frame() { must_construct_frame_ = true; } |
991 | 995 |
992 bool must_deconstruct_frame() const { return must_deconstruct_frame_; } | 996 bool must_deconstruct_frame() const { return must_deconstruct_frame_; } |
993 void mark_must_deconstruct_frame() { must_deconstruct_frame_ = true; } | 997 void mark_must_deconstruct_frame() { must_deconstruct_frame_ = true; } |
994 | 998 |
| 999 void set_last_deferred(RpoNumber last) { last_deferred_ = last; } |
| 1000 RpoNumber last_deferred() const { return last_deferred_; } |
| 1001 |
995 private: | 1002 private: |
996 Successors successors_; | 1003 Successors successors_; |
997 Predecessors predecessors_; | 1004 Predecessors predecessors_; |
998 PhiInstructions phis_; | 1005 PhiInstructions phis_; |
999 RpoNumber ao_number_; // Assembly order number. | 1006 RpoNumber ao_number_; // Assembly order number. |
1000 const RpoNumber rpo_number_; | 1007 const RpoNumber rpo_number_; |
1001 const RpoNumber loop_header_; | 1008 const RpoNumber loop_header_; |
1002 const RpoNumber loop_end_; | 1009 const RpoNumber loop_end_; |
1003 int32_t code_start_; // start index of arch-specific code. | 1010 int32_t code_start_; // start index of arch-specific code. |
1004 int32_t code_end_; // end index of arch-specific code. | 1011 int32_t code_end_; // end index of arch-specific code. |
1005 const bool deferred_; // Block contains deferred code. | 1012 const bool deferred_; // Block contains deferred code. |
1006 const bool handler_; // Block is a handler entry point. | 1013 const bool handler_; // Block is a handler entry point. |
1007 bool needs_frame_; | 1014 bool needs_frame_; |
1008 bool must_construct_frame_; | 1015 bool must_construct_frame_; |
1009 bool must_deconstruct_frame_; | 1016 bool must_deconstruct_frame_; |
| 1017 RpoNumber last_deferred_; |
1010 }; | 1018 }; |
1011 | 1019 |
1012 typedef ZoneDeque<Constant> ConstantDeque; | 1020 typedef ZoneDeque<Constant> ConstantDeque; |
1013 typedef std::map<int, Constant, std::less<int>, | 1021 typedef std::map<int, Constant, std::less<int>, |
1014 zone_allocator<std::pair<int, Constant> > > ConstantMap; | 1022 zone_allocator<std::pair<int, Constant> > > ConstantMap; |
1015 | 1023 |
1016 typedef ZoneDeque<Instruction*> InstructionDeque; | 1024 typedef ZoneDeque<Instruction*> InstructionDeque; |
1017 typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque; | 1025 typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque; |
1018 typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; | 1026 typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; |
1019 typedef ZoneVector<InstructionBlock*> InstructionBlocks; | 1027 typedef ZoneVector<InstructionBlock*> InstructionBlocks; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1205 | 1213 |
1206 | 1214 |
1207 std::ostream& operator<<(std::ostream& os, | 1215 std::ostream& operator<<(std::ostream& os, |
1208 const PrintableInstructionSequence& code); | 1216 const PrintableInstructionSequence& code); |
1209 | 1217 |
1210 } // namespace compiler | 1218 } // namespace compiler |
1211 } // namespace internal | 1219 } // namespace internal |
1212 } // namespace v8 | 1220 } // namespace v8 |
1213 | 1221 |
1214 #endif // V8_COMPILER_INSTRUCTION_H_ | 1222 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |