| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_INTERPRETER_BYTECODES_H_ | 5 #ifndef V8_INTERPRETER_BYTECODES_H_ |
| 6 #define V8_INTERPRETER_BYTECODES_H_ | 6 #define V8_INTERPRETER_BYTECODES_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 // Clients of this interface shouldn't depend on lots of interpreter internals. | 10 // Clients of this interface shouldn't depend on lots of interpreter internals. |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 bool is_function_context() const; | 203 bool is_function_context() const; |
| 204 | 204 |
| 205 static Register FromOperand(uint8_t operand); | 205 static Register FromOperand(uint8_t operand); |
| 206 uint8_t ToOperand() const; | 206 uint8_t ToOperand() const; |
| 207 | 207 |
| 208 static bool AreContiguous(Register reg1, Register reg2, | 208 static bool AreContiguous(Register reg1, Register reg2, |
| 209 Register reg3 = Register(), | 209 Register reg3 = Register(), |
| 210 Register reg4 = Register(), | 210 Register reg4 = Register(), |
| 211 Register reg5 = Register()); | 211 Register reg5 = Register()); |
| 212 | 212 |
| 213 bool operator==(const Register& o) const { return o.index() == index(); } | 213 bool operator==(const Register& other) const { |
| 214 bool operator!=(const Register& o) const { return o.index() != index(); } | 214 return index() == other.index(); |
| 215 } |
| 216 bool operator!=(const Register& other) const { |
| 217 return index() != other.index(); |
| 218 } |
| 219 bool operator<(const Register& other) const { |
| 220 return index() < other.index(); |
| 221 } |
| 222 bool operator<=(const Register& other) const { |
| 223 return index() <= other.index(); |
| 224 } |
| 215 | 225 |
| 216 private: | 226 private: |
| 217 static const int kIllegalIndex = kMaxInt; | 227 static const int kIllegalIndex = kMaxInt; |
| 218 | 228 |
| 219 void* operator new(size_t size); | 229 void* operator new(size_t size); |
| 220 void operator delete(void* p); | 230 void operator delete(void* p); |
| 221 | 231 |
| 222 int index_; | 232 int index_; |
| 223 }; | 233 }; |
| 224 | 234 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 293 |
| 284 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 294 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
| 285 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 295 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
| 286 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 296 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
| 287 | 297 |
| 288 } // namespace interpreter | 298 } // namespace interpreter |
| 289 } // namespace internal | 299 } // namespace internal |
| 290 } // namespace v8 | 300 } // namespace v8 |
| 291 | 301 |
| 292 #endif // V8_INTERPRETER_BYTECODES_H_ | 302 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |