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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
498 static OperandType GetOperandType(Bytecode bytecode, int i); | 498 static OperandType GetOperandType(Bytecode bytecode, int i); |
499 | 499 |
500 // Returns a pointer to an array of operand types terminated in | 500 // Returns a pointer to an array of operand types terminated in |
501 // OperandType::kNone. | 501 // OperandType::kNone. |
502 static const OperandType* GetOperandTypes(Bytecode bytecode); | 502 static const OperandType* GetOperandTypes(Bytecode bytecode); |
503 | 503 |
504 // Returns the size of the i-th operand of |bytecode|. | 504 // Returns the size of the i-th operand of |bytecode|. |
505 static OperandSize GetOperandSize(Bytecode bytecode, int i, | 505 static OperandSize GetOperandSize(Bytecode bytecode, int i, |
506 OperandScale operand_scale); | 506 OperandScale operand_scale); |
507 | 507 |
| 508 // Returns a pointer to an array of the operand sizes for |bytecode|. |
| 509 static const OperandSize* GetOperandSizes(Bytecode bytecode, |
| 510 OperandScale operand_scale); |
| 511 |
508 // Returns the offset of the i-th operand of |bytecode| relative to the start | 512 // Returns the offset of the i-th operand of |bytecode| relative to the start |
509 // of the bytecode. | 513 // of the bytecode. |
510 static int GetOperandOffset(Bytecode bytecode, int i, | 514 static int GetOperandOffset(Bytecode bytecode, int i, |
511 OperandScale operand_scale); | 515 OperandScale operand_scale); |
512 | 516 |
513 // Returns a zero-based bitmap of the register operand positions of | 517 // Returns a zero-based bitmap of the register operand positions of |
514 // |bytecode|. | 518 // |bytecode|. |
515 static int GetRegisterOperandBitmap(Bytecode bytecode); | 519 static int GetRegisterOperandBitmap(Bytecode bytecode); |
516 | 520 |
517 // Returns a debug break bytecode to replace |bytecode|. | 521 // Returns a debug break bytecode to replace |bytecode|. |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 static OperandSize SizeForSignedOperand(int value); | 639 static OperandSize SizeForSignedOperand(int value); |
636 | 640 |
637 // Return the operand size required to hold an unsigned operand. | 641 // Return the operand size required to hold an unsigned operand. |
638 static OperandSize SizeForUnsignedOperand(int value); | 642 static OperandSize SizeForUnsignedOperand(int value); |
639 | 643 |
640 // Return the operand size required to hold an unsigned operand. | 644 // Return the operand size required to hold an unsigned operand. |
641 static OperandSize SizeForUnsignedOperand(size_t value); | 645 static OperandSize SizeForUnsignedOperand(size_t value); |
642 | 646 |
643 // Return the OperandScale required for bytecode emission of | 647 // Return the OperandScale required for bytecode emission of |
644 // operand sizes. | 648 // operand sizes. |
| 649 static OperandScale OperandSizesToScale(OperandSize size0); |
| 650 static OperandScale OperandSizesToScale(OperandSize size0, OperandSize size1); |
645 static OperandScale OperandSizesToScale( | 651 static OperandScale OperandSizesToScale( |
646 OperandSize size0, OperandSize size1 = OperandSize::kByte, | 652 OperandSize size0, OperandSize size1, OperandSize size2, |
647 OperandSize size2 = OperandSize::kByte, | |
648 OperandSize size3 = OperandSize::kByte); | 653 OperandSize size3 = OperandSize::kByte); |
649 | 654 |
650 private: | 655 private: |
651 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 656 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
652 }; | 657 }; |
653 | 658 |
654 class CreateObjectLiteralFlags { | 659 class CreateObjectLiteralFlags { |
655 public: | 660 public: |
656 class FlagsBits : public BitField8<int, 0, 3> {}; | 661 class FlagsBits : public BitField8<int, 0, 3> {}; |
657 class FastClonePropertiesCountBits | 662 class FastClonePropertiesCountBits |
658 : public BitField8<int, FlagsBits::kNext, 3> {}; | 663 : public BitField8<int, FlagsBits::kNext, 3> {}; |
659 STATIC_ASSERT((FlagsBits::kMask & FastClonePropertiesCountBits::kMask) == 0); | 664 STATIC_ASSERT((FlagsBits::kMask & FastClonePropertiesCountBits::kMask) == 0); |
660 }; | 665 }; |
661 | 666 |
662 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 667 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
663 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); | 668 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); |
664 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 669 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
665 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 670 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
666 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 671 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
667 | 672 |
668 } // namespace interpreter | 673 } // namespace interpreter |
669 } // namespace internal | 674 } // namespace internal |
670 } // namespace v8 | 675 } // namespace v8 |
671 | 676 |
672 #endif // V8_INTERPRETER_BYTECODES_H_ | 677 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |