| 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 24 matching lines...) Expand all Loading... |
| 35 public: | 35 public: |
| 36 // Returns string representation of |bytecode|. | 36 // Returns string representation of |bytecode|. |
| 37 static const char* ToString(Bytecode bytecode); | 37 static const char* ToString(Bytecode bytecode); |
| 38 | 38 |
| 39 // Returns the number of arguments expected by |bytecode|. | 39 // Returns the number of arguments expected by |bytecode|. |
| 40 static const int NumberOfArguments(Bytecode bytecode); | 40 static const int NumberOfArguments(Bytecode bytecode); |
| 41 | 41 |
| 42 // Returns the size of the bytecode including its arguments. | 42 // Returns the size of the bytecode including its arguments. |
| 43 static const int Size(Bytecode bytecode); | 43 static const int Size(Bytecode bytecode); |
| 44 | 44 |
| 45 // The maximum number of arguments across all bytecodes. |
| 46 static const int kMaximumNumberOfArguments = 1; |
| 47 |
| 48 // Maximum size of a bytecode and its arguments. |
| 49 static const int kMaximumSize = 1 + kMaximumNumberOfArguments; |
| 50 |
| 45 private: | 51 private: |
| 46 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); | 52 DISALLOW_IMPLICIT_CONSTRUCTORS(Bytecodes); |
| 47 }; | 53 }; |
| 48 | 54 |
| 49 | |
| 50 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 55 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
| 51 | 56 |
| 52 } // namespace interpreter | 57 } // namespace interpreter |
| 53 } // namespace internal | 58 } // namespace internal |
| 54 } // namespace v8 | 59 } // namespace v8 |
| 55 | 60 |
| 56 #endif // V8_INTERPRETER_BYTECODES_H_ | 61 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |