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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 | 505 |
506 // Decodes an unsigned operand in a byte array. | 506 // Decodes an unsigned operand in a byte array. |
507 static uint32_t DecodeUnsignedOperand(const uint8_t* operand_start, | 507 static uint32_t DecodeUnsignedOperand(const uint8_t* operand_start, |
508 OperandType operand_type, | 508 OperandType operand_type, |
509 OperandScale operand_scale); | 509 OperandScale operand_scale); |
510 | 510 |
511 // Decode a single bytecode and operands to |os|. | 511 // Decode a single bytecode and operands to |os|. |
512 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start, | 512 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start, |
513 int number_of_parameters); | 513 int number_of_parameters); |
514 | 514 |
| 515 // Returns true if a handler is generated for a bytecode at a given |
| 516 // operand scale. All bytecodes have handlers at OperandScale::kSingle, |
| 517 // but only bytecodes with scalable operands have handlers with larger |
| 518 // OperandScale values. |
| 519 static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale); |
| 520 |
515 // Return the next larger operand scale. | 521 // Return the next larger operand scale. |
516 static OperandScale NextOperandScale(OperandScale operand_scale); | 522 static OperandScale NextOperandScale(OperandScale operand_scale); |
517 | 523 |
518 private: | 524 private: |
519 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 525 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
520 }; | 526 }; |
521 | 527 |
522 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 528 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
523 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 529 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
524 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 530 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
525 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 531 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
526 | 532 |
527 } // namespace interpreter | 533 } // namespace interpreter |
528 } // namespace internal | 534 } // namespace internal |
529 } // namespace v8 | 535 } // namespace v8 |
530 | 536 |
531 #endif // V8_INTERPRETER_BYTECODES_H_ | 537 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |