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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 static OperandType GetOperandType(Bytecode bytecode, int i); | 484 static OperandType GetOperandType(Bytecode bytecode, int i); |
485 | 485 |
486 // Returns a pointer to an array of operand types terminated in | 486 // Returns a pointer to an array of operand types terminated in |
487 // OperandType::kNone. | 487 // OperandType::kNone. |
488 static const OperandType* GetOperandTypes(Bytecode bytecode); | 488 static const OperandType* GetOperandTypes(Bytecode bytecode); |
489 | 489 |
490 // Returns the size of the i-th operand of |bytecode|. | 490 // Returns the size of the i-th operand of |bytecode|. |
491 static OperandSize GetOperandSize(Bytecode bytecode, int i, | 491 static OperandSize GetOperandSize(Bytecode bytecode, int i, |
492 OperandScale operand_scale); | 492 OperandScale operand_scale); |
493 | 493 |
| 494 // Returns a pointer to an array of the operand sizes for |bytecode|. |
| 495 static const OperandSize* GetOperandSizes(Bytecode bytecode, |
| 496 OperandScale operand_scale); |
| 497 |
494 // Returns the offset of the i-th operand of |bytecode| relative to the start | 498 // Returns the offset of the i-th operand of |bytecode| relative to the start |
495 // of the bytecode. | 499 // of the bytecode. |
496 static int GetOperandOffset(Bytecode bytecode, int i, | 500 static int GetOperandOffset(Bytecode bytecode, int i, |
497 OperandScale operand_scale); | 501 OperandScale operand_scale); |
498 | 502 |
499 // Returns a zero-based bitmap of the register operand positions of | 503 // Returns a zero-based bitmap of the register operand positions of |
500 // |bytecode|. | 504 // |bytecode|. |
501 static int GetRegisterOperandBitmap(Bytecode bytecode); | 505 static int GetRegisterOperandBitmap(Bytecode bytecode); |
502 | 506 |
503 // Returns a debug break bytecode to replace |bytecode|. | 507 // Returns a debug break bytecode to replace |bytecode|. |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 static OperandSize SizeForSignedOperand(int value); | 621 static OperandSize SizeForSignedOperand(int value); |
618 | 622 |
619 // Return the operand size required to hold an unsigned operand. | 623 // Return the operand size required to hold an unsigned operand. |
620 static OperandSize SizeForUnsignedOperand(int value); | 624 static OperandSize SizeForUnsignedOperand(int value); |
621 | 625 |
622 // Return the operand size required to hold an unsigned operand. | 626 // Return the operand size required to hold an unsigned operand. |
623 static OperandSize SizeForUnsignedOperand(size_t value); | 627 static OperandSize SizeForUnsignedOperand(size_t value); |
624 | 628 |
625 // Return the OperandScale required for bytecode emission of | 629 // Return the OperandScale required for bytecode emission of |
626 // operand sizes. | 630 // operand sizes. |
| 631 static OperandScale OperandSizesToScale(OperandSize size0); |
| 632 static OperandScale OperandSizesToScale(OperandSize size0, OperandSize size1); |
627 static OperandScale OperandSizesToScale( | 633 static OperandScale OperandSizesToScale( |
628 OperandSize size0, OperandSize size1 = OperandSize::kByte, | 634 OperandSize size0, OperandSize size1, OperandSize size2, |
629 OperandSize size2 = OperandSize::kByte, | |
630 OperandSize size3 = OperandSize::kByte); | 635 OperandSize size3 = OperandSize::kByte); |
631 | 636 |
632 private: | 637 private: |
633 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 638 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
634 }; | 639 }; |
635 | 640 |
636 class CreateObjectLiteralFlags { | 641 class CreateObjectLiteralFlags { |
637 public: | 642 public: |
638 class FlagsBits : public BitField8<int, 0, 3> {}; | 643 class FlagsBits : public BitField8<int, 0, 3> {}; |
639 class FastClonePropertiesCountBits | 644 class FastClonePropertiesCountBits |
640 : public BitField8<int, FlagsBits::kNext, 3> {}; | 645 : public BitField8<int, FlagsBits::kNext, 3> {}; |
641 STATIC_ASSERT((FlagsBits::kMask & FastClonePropertiesCountBits::kMask) == 0); | 646 STATIC_ASSERT((FlagsBits::kMask & FastClonePropertiesCountBits::kMask) == 0); |
642 }; | 647 }; |
643 | 648 |
644 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 649 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
645 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); | 650 std::ostream& operator<<(std::ostream& os, const AccumulatorUse& use); |
646 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); | 651 std::ostream& operator<<(std::ostream& os, const OperandScale& operand_scale); |
647 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); | 652 std::ostream& operator<<(std::ostream& os, const OperandSize& operand_size); |
648 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); | 653 std::ostream& operator<<(std::ostream& os, const OperandType& operand_type); |
649 | 654 |
650 } // namespace interpreter | 655 } // namespace interpreter |
651 } // namespace internal | 656 } // namespace internal |
652 } // namespace v8 | 657 } // namespace v8 |
653 | 658 |
654 #endif // V8_INTERPRETER_BYTECODES_H_ | 659 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |