Chromium Code Reviews| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 | 83 |
| 84 // Returns bytecode for |value|. | 84 // Returns bytecode for |value|. |
| 85 static Bytecode FromByte(uint8_t value); | 85 static Bytecode FromByte(uint8_t value); |
| 86 | 86 |
| 87 // Returns the number of operands expected by |bytecode|. | 87 // Returns the number of operands expected by |bytecode|. |
| 88 static int NumberOfOperands(Bytecode bytecode); | 88 static int NumberOfOperands(Bytecode bytecode); |
| 89 | 89 |
| 90 // Return the i-th operand of |bytecode|. | 90 // Return the i-th operand of |bytecode|. |
| 91 static OperandType GetOperandType(Bytecode bytecode, int i); | 91 static OperandType GetOperandType(Bytecode bytecode, int i); |
| 92 | 92 |
| 93 // Returns the size of the bytecode including its arguments. | 93 // Returns the size of the bytecode including its operands. |
| 94 static int Size(Bytecode bytecode); | 94 static int Size(Bytecode bytecode); |
| 95 | 95 |
| 96 // The maximum number of operands across all bytecodes. | 96 // The maximum number of operands across all bytecodes. |
| 97 static int MaximumNumberOfOperands(); | 97 static int MaximumNumberOfOperands(); |
| 98 | 98 |
| 99 // Maximum size of a bytecode and its arguments. | 99 // Maximum size of a bytecode and its operands. |
| 100 static int MaximumSize(); | 100 static int MaximumSize(); |
| 101 | 101 |
| 102 // Decode a single bytecode and operands to |os|. | |
| 103 static std::ostream& Decode(std::ostream& os, const uint8_t* bytecode_start, | |
| 104 const uint8_t* bytecode_end); | |
|
Michael Starzinger
2015/08/03 15:59:09
It looks like the {bytecode_end} argument is only
| |
| 105 | |
| 102 private: | 106 private: |
| 103 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 107 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
| 104 }; | 108 }; |
| 105 | 109 |
| 106 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 110 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
| 107 | 111 |
| 108 } // namespace interpreter | 112 } // namespace interpreter |
| 109 } // namespace internal | 113 } // namespace internal |
| 110 } // namespace v8 | 114 } // namespace v8 |
| 111 | 115 |
| 112 #endif // V8_INTERPRETER_BYTECODES_H_ | 116 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |