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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
57 /* Context operations */ \ | 57 /* Context operations */ \ |
58 V(PushContext, OperandType::kReg8) \ | 58 V(PushContext, OperandType::kReg8) \ |
59 V(PopContext, OperandType::kReg8) \ | 59 V(PopContext, OperandType::kReg8) \ |
60 V(LdaContextSlot, OperandType::kReg8, OperandType::kIdx8) \ | 60 V(LdaContextSlot, OperandType::kReg8, OperandType::kIdx8) \ |
61 V(StaContextSlot, OperandType::kReg8, OperandType::kIdx8) \ | 61 V(StaContextSlot, OperandType::kReg8, OperandType::kIdx8) \ |
62 \ | 62 \ |
63 /* Register-accumulator transfers */ \ | 63 /* Register-accumulator transfers */ \ |
64 V(Ldar, OperandType::kReg8) \ | 64 V(Ldar, OperandType::kReg8) \ |
65 V(Star, OperandType::kReg8) \ | 65 V(Star, OperandType::kReg8) \ |
66 \ | 66 \ |
67 /* Register-register transfers */ \ | |
68 V(Mov, OperandType::kReg8, OperandType::kReg8) \ | |
69 \ | |
67 /* LoadIC operations */ \ | 70 /* LoadIC operations */ \ |
68 V(LoadICSloppy, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \ | 71 V(LoadICSloppy, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \ |
69 V(LoadICStrict, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \ | 72 V(LoadICStrict, OperandType::kReg8, OperandType::kIdx8, OperandType::kIdx8) \ |
70 V(KeyedLoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \ | 73 V(KeyedLoadICSloppy, OperandType::kReg8, OperandType::kIdx8) \ |
71 V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ | 74 V(KeyedLoadICStrict, OperandType::kReg8, OperandType::kIdx8) \ |
72 /* TODO(rmcilroy): Wide register operands too? */ \ | 75 /* TODO(rmcilroy): Wide register operands too? */ \ |
73 V(LoadICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \ | 76 V(LoadICSloppyWide, OperandType::kReg8, OperandType::kIdx16, \ |
74 OperandType::kIdx16) \ | 77 OperandType::kIdx16) \ |
75 V(LoadICStrictWide, OperandType::kReg8, OperandType::kIdx16, \ | 78 V(LoadICStrictWide, OperandType::kReg8, OperandType::kIdx16, \ |
76 OperandType::kIdx16) \ | 79 OperandType::kIdx16) \ |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
253 Register reg3 = Register(), | 256 Register reg3 = Register(), |
254 Register reg4 = Register(), | 257 Register reg4 = Register(), |
255 Register reg5 = Register()); | 258 Register reg5 = Register()); |
256 | 259 |
257 bool operator==(const Register& other) const { | 260 bool operator==(const Register& other) const { |
258 return index() == other.index(); | 261 return index() == other.index(); |
259 } | 262 } |
260 bool operator!=(const Register& other) const { | 263 bool operator!=(const Register& other) const { |
261 return index() != other.index(); | 264 return index() != other.index(); |
262 } | 265 } |
263 bool operator<(const Register& other) const { | 266 bool operator<(const Register& other) const { return index_ < other.index_; } |
rmcilroy
2015/11/03 14:17:52
Could you check why this is needed?
oth
2015/11/04 10:03:37
Restored. No longer needed, not sure where in the
| |
264 return index() < other.index(); | |
265 } | |
266 bool operator<=(const Register& other) const { | 267 bool operator<=(const Register& other) const { |
267 return index() <= other.index(); | 268 return index() <= other.index(); |
268 } | 269 } |
269 | 270 |
270 private: | 271 private: |
271 static const int kIllegalIndex = kMaxInt; | 272 static const int kIllegalIndex = kMaxInt; |
272 | 273 |
273 void* operator new(size_t size); | |
274 void operator delete(void* p); | |
rmcilroy
2015/11/03 14:17:52
We could keep this by using index() in the contain
oth
2015/11/04 10:03:37
Put these back and went with index() in the contai
| |
275 | |
276 int index_; | 274 int index_; |
277 }; | 275 }; |
278 | 276 |
279 | 277 |
280 class Bytecodes { | 278 class Bytecodes { |
281 public: | 279 public: |
282 // Returns string representation of |bytecode|. | 280 // Returns string representation of |bytecode|. |
283 static const char* ToString(Bytecode bytecode); | 281 static const char* ToString(Bytecode bytecode); |
284 | 282 |
285 // Returns string representation of |operand_type|. | 283 // Returns string representation of |operand_type|. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
337 | 335 |
338 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 336 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
339 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 337 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
340 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); | 338 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_type); |
341 | 339 |
342 } // namespace interpreter | 340 } // namespace interpreter |
343 } // namespace internal | 341 } // namespace internal |
344 } // namespace v8 | 342 } // namespace v8 |
345 | 343 |
346 #endif // V8_INTERPRETER_BYTECODES_H_ | 344 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |