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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Returns string representation of |bytecode|. | 59 // Returns string representation of |bytecode|. |
60 static const char* ToString(Bytecode bytecode); | 60 static const char* ToString(Bytecode bytecode); |
61 | 61 |
62 // Returns byte value of bytecode. | 62 // Returns byte value of bytecode. |
63 static uint8_t ToByte(Bytecode bytecode); | 63 static uint8_t ToByte(Bytecode bytecode); |
64 | 64 |
65 // Returns bytecode for |value|. | 65 // Returns bytecode for |value|. |
66 static Bytecode FromByte(uint8_t value); | 66 static Bytecode FromByte(uint8_t value); |
67 | 67 |
68 // Returns the number of operands expected by |bytecode|. | 68 // Returns the number of operands expected by |bytecode|. |
69 static const int NumberOfOperands(Bytecode bytecode); | 69 static int NumberOfOperands(Bytecode bytecode); |
70 | 70 |
71 // Return the i-th operand of |bytecode|. | 71 // Return the i-th operand of |bytecode|. |
72 static const OperandType GetOperandType(Bytecode bytecode, int i); | 72 static OperandType GetOperandType(Bytecode bytecode, int i); |
73 | 73 |
74 // Returns the size of the bytecode including its arguments. | 74 // Returns the size of the bytecode including its arguments. |
75 static const int Size(Bytecode bytecode); | 75 static int Size(Bytecode bytecode); |
76 | 76 |
77 // The maximum number of operands across all bytecodes. | 77 // The maximum number of operands across all bytecodes. |
78 static const int MaximumNumberOfOperands(); | 78 static int MaximumNumberOfOperands(); |
79 | 79 |
80 // Maximum size of a bytecode and its arguments. | 80 // Maximum size of a bytecode and its arguments. |
81 static const int MaximumSize(); | 81 static int MaximumSize(); |
82 | 82 |
83 private: | 83 private: |
84 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 84 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
85 }; | 85 }; |
86 | 86 |
87 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 87 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
88 | 88 |
89 } // namespace interpreter | 89 } // namespace interpreter |
90 } // namespace internal | 90 } // namespace internal |
91 } // namespace v8 | 91 } // namespace v8 |
92 | 92 |
93 #endif // V8_INTERPRETER_BYTECODES_H_ | 93 #endif // V8_INTERPRETER_BYTECODES_H_ |
OLD | NEW |