OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_HYDROGEN_INSTRUCTIONS_H_ | 5 #ifndef V8_HYDROGEN_INSTRUCTIONS_H_ |
6 #define V8_HYDROGEN_INSTRUCTIONS_H_ | 6 #define V8_HYDROGEN_INSTRUCTIONS_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 | 10 |
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
975 // In the second case it points to an array which contains instruction's | 975 // In the second case it points to an array which contains instruction's |
976 // position and operands' positions. | 976 // position and operands' positions. |
977 class HPositionInfo { | 977 class HPositionInfo { |
978 public: | 978 public: |
979 explicit HPositionInfo(int pos) : data_(TagPosition(pos)) { } | 979 explicit HPositionInfo(int pos) : data_(TagPosition(pos)) { } |
980 | 980 |
981 SourcePosition position() const { | 981 SourcePosition position() const { |
982 if (has_operand_positions()) { | 982 if (has_operand_positions()) { |
983 return operand_positions()[kInstructionPosIndex]; | 983 return operand_positions()[kInstructionPosIndex]; |
984 } | 984 } |
985 return SourcePosition(static_cast<int>(UntagPosition(data_))); | 985 return SourcePosition::FromRaw(static_cast<int>(UntagPosition(data_))); |
986 } | 986 } |
987 | 987 |
988 void set_position(SourcePosition pos) { | 988 void set_position(SourcePosition pos) { |
989 if (has_operand_positions()) { | 989 if (has_operand_positions()) { |
990 operand_positions()[kInstructionPosIndex] = pos; | 990 operand_positions()[kInstructionPosIndex] = pos; |
991 } else { | 991 } else { |
992 data_ = TagPosition(pos.raw()); | 992 data_ = TagPosition(pos.raw()); |
993 } | 993 } |
994 } | 994 } |
995 | 995 |
(...skipping 6968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7964 }; | 7964 }; |
7965 | 7965 |
7966 | 7966 |
7967 | 7967 |
7968 #undef DECLARE_INSTRUCTION | 7968 #undef DECLARE_INSTRUCTION |
7969 #undef DECLARE_CONCRETE_INSTRUCTION | 7969 #undef DECLARE_CONCRETE_INSTRUCTION |
7970 | 7970 |
7971 } } // namespace v8::internal | 7971 } } // namespace v8::internal |
7972 | 7972 |
7973 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ | 7973 #endif // V8_HYDROGEN_INSTRUCTIONS_H_ |
OLD | NEW |