Chromium Code Reviews| 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 bool operator==(RpoNumber other) const { |
| 782 return this->index_ == other.index_; | 782 return this->index_ == other.index_; |
| 783 } | 783 } |
| 784 | 784 |
|
Benedikt Meurer
2015/08/24 04:33:26
Nit: please add operator!= for consistency.
Mircea Trofin
2015/08/24 20:55:10
Done.
| |
| 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_; } | |
| 788 bool operator>=(RpoNumber other) const { return index_ >= other.index_; } | |
| 789 | |
| 785 private: | 790 private: |
| 786 explicit RpoNumber(int32_t index) : index_(index) {} | 791 explicit RpoNumber(int32_t index) : index_(index) {} |
| 787 int32_t index_; | 792 int32_t index_; |
| 788 }; | 793 }; |
| 789 | 794 |
| 790 | 795 |
| 791 std::ostream& operator<<(std::ostream&, const RpoNumber&); | 796 std::ostream& operator<<(std::ostream&, const RpoNumber&); |
| 792 | 797 |
| 793 | 798 |
| 794 class Constant final { | 799 class Constant final { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 985 | 990 |
| 986 bool needs_frame() const { return needs_frame_; } | 991 bool needs_frame() const { return needs_frame_; } |
| 987 void mark_needs_frame() { needs_frame_ = true; } | 992 void mark_needs_frame() { needs_frame_ = true; } |
| 988 | 993 |
| 989 bool must_construct_frame() const { return must_construct_frame_; } | 994 bool must_construct_frame() const { return must_construct_frame_; } |
| 990 void mark_must_construct_frame() { must_construct_frame_ = true; } | 995 void mark_must_construct_frame() { must_construct_frame_ = true; } |
| 991 | 996 |
| 992 bool must_deconstruct_frame() const { return must_deconstruct_frame_; } | 997 bool must_deconstruct_frame() const { return must_deconstruct_frame_; } |
| 993 void mark_must_deconstruct_frame() { must_deconstruct_frame_ = true; } | 998 void mark_must_deconstruct_frame() { must_deconstruct_frame_ = true; } |
| 994 | 999 |
| 1000 void set_last_deferred(RpoNumber last) { last_deferred_ = last; } | |
| 1001 RpoNumber last_deferred() const { return last_deferred_; } | |
| 1002 | |
| 995 private: | 1003 private: |
| 996 Successors successors_; | 1004 Successors successors_; |
| 997 Predecessors predecessors_; | 1005 Predecessors predecessors_; |
| 998 PhiInstructions phis_; | 1006 PhiInstructions phis_; |
| 999 RpoNumber ao_number_; // Assembly order number. | 1007 RpoNumber ao_number_; // Assembly order number. |
| 1000 const RpoNumber rpo_number_; | 1008 const RpoNumber rpo_number_; |
| 1001 const RpoNumber loop_header_; | 1009 const RpoNumber loop_header_; |
| 1002 const RpoNumber loop_end_; | 1010 const RpoNumber loop_end_; |
| 1003 int32_t code_start_; // start index of arch-specific code. | 1011 int32_t code_start_; // start index of arch-specific code. |
| 1004 int32_t code_end_; // end index of arch-specific code. | 1012 int32_t code_end_; // end index of arch-specific code. |
| 1005 const bool deferred_; // Block contains deferred code. | 1013 const bool deferred_; // Block contains deferred code. |
| 1006 const bool handler_; // Block is a handler entry point. | 1014 const bool handler_; // Block is a handler entry point. |
| 1007 bool needs_frame_; | 1015 bool needs_frame_; |
| 1008 bool must_construct_frame_; | 1016 bool must_construct_frame_; |
| 1009 bool must_deconstruct_frame_; | 1017 bool must_deconstruct_frame_; |
| 1018 RpoNumber last_deferred_; | |
| 1010 }; | 1019 }; |
| 1011 | 1020 |
| 1012 typedef ZoneDeque<Constant> ConstantDeque; | 1021 typedef ZoneDeque<Constant> ConstantDeque; |
| 1013 typedef std::map<int, Constant, std::less<int>, | 1022 typedef std::map<int, Constant, std::less<int>, |
| 1014 zone_allocator<std::pair<int, Constant> > > ConstantMap; | 1023 zone_allocator<std::pair<int, Constant> > > ConstantMap; |
| 1015 | 1024 |
| 1016 typedef ZoneDeque<Instruction*> InstructionDeque; | 1025 typedef ZoneDeque<Instruction*> InstructionDeque; |
| 1017 typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque; | 1026 typedef ZoneDeque<ReferenceMap*> ReferenceMapDeque; |
| 1018 typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; | 1027 typedef ZoneVector<FrameStateDescriptor*> DeoptimizationVector; |
| 1019 typedef ZoneVector<InstructionBlock*> InstructionBlocks; | 1028 typedef ZoneVector<InstructionBlock*> InstructionBlocks; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1205 | 1214 |
| 1206 | 1215 |
| 1207 std::ostream& operator<<(std::ostream& os, | 1216 std::ostream& operator<<(std::ostream& os, |
| 1208 const PrintableInstructionSequence& code); | 1217 const PrintableInstructionSequence& code); |
| 1209 | 1218 |
| 1210 } // namespace compiler | 1219 } // namespace compiler |
| 1211 } // namespace internal | 1220 } // namespace internal |
| 1212 } // namespace v8 | 1221 } // namespace v8 |
| 1213 | 1222 |
| 1214 #endif // V8_COMPILER_INSTRUCTION_H_ | 1223 #endif // V8_COMPILER_INSTRUCTION_H_ |
| OLD | NEW |