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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 bool Equals(const InstructionOperand* other) const { | 56 bool Equals(const InstructionOperand* other) const { |
57 return value_ == other->value_; | 57 return value_ == other->value_; |
58 } | 58 } |
59 | 59 |
60 // Useful for map/set keys. | 60 // Useful for map/set keys. |
61 bool operator<(const InstructionOperand& op) const { | 61 bool operator<(const InstructionOperand& op) const { |
62 return value_ < op.value_; | 62 return value_ < op.value_; |
63 } | 63 } |
64 | 64 |
| 65 bool operator==(const InstructionOperand& op) const { |
| 66 return value_ == op.value_; |
| 67 } |
| 68 |
65 template <typename SubKindOperand> | 69 template <typename SubKindOperand> |
66 static SubKindOperand* New(Zone* zone, const SubKindOperand& op) { | 70 static SubKindOperand* New(Zone* zone, const SubKindOperand& op) { |
67 void* buffer = zone->New(sizeof(op)); | 71 void* buffer = zone->New(sizeof(op)); |
68 return new (buffer) SubKindOperand(op); | 72 return new (buffer) SubKindOperand(op); |
69 } | 73 } |
70 | 74 |
71 static void ReplaceWith(InstructionOperand* dest, | 75 static void ReplaceWith(InstructionOperand* dest, |
72 const InstructionOperand* src) { | 76 const InstructionOperand* src) { |
73 *dest = *src; | 77 *dest = *src; |
74 } | 78 } |
(...skipping 1064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 | 1143 |
1140 | 1144 |
1141 std::ostream& operator<<(std::ostream& os, | 1145 std::ostream& operator<<(std::ostream& os, |
1142 const PrintableInstructionSequence& code); | 1146 const PrintableInstructionSequence& code); |
1143 | 1147 |
1144 } // namespace compiler | 1148 } // namespace compiler |
1145 } // namespace internal | 1149 } // namespace internal |
1146 } // namespace v8 | 1150 } // namespace v8 |
1147 | 1151 |
1148 #endif // V8_COMPILER_INSTRUCTION_H_ | 1152 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |