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 #include "src/utils.h" | 10 #include "src/utils.h" |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 | 36 |
| 37 // Returns the number of arguments expected by |bytecode|. | 37 // Returns the number of arguments expected by |bytecode|. |
| 38 static const int NumberOfArguments(Bytecode bytecode); | 38 static const int NumberOfArguments(Bytecode bytecode); |
| 39 | 39 |
| 40 // Returns the size of the bytecode including its arguments. | 40 // Returns the size of the bytecode including its arguments. |
| 41 static const int Size(Bytecode bytecode); | 41 static const int Size(Bytecode bytecode); |
| 42 | 42 |
| 43 // Returns true if the bytecode is a function return bytecode. | 43 // Returns true if the bytecode is a function return bytecode. |
| 44 static const bool IsReturn(Bytecode bytecode); | 44 static const bool IsReturn(Bytecode bytecode); |
| 45 | 45 |
| 46 // The maximum number of arguments across all bytecodes. | |
| 47 static const int kMaximumNumberOfArguments = 1; | |
| 48 | |
| 49 // Maximum size of a bytecode and its arguments. | |
| 50 static const int kMaximumSize = 1 + kMaximumNumberOfArguments; | |
|
rmcilroy
2015/07/21 11:25:16
Is this just used for the disassembly? I don't thi
| |
| 51 | |
| 46 private: | 52 private: |
| 47 Bytecodes() { UNREACHABLE(); } | 53 Bytecodes() { UNREACHABLE(); } |
| 48 }; | 54 }; |
| 49 | 55 |
| 50 | |
| 51 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); | 56 std::ostream& operator<<(std::ostream& os, const Bytecode& bytecode); |
| 52 | 57 |
| 53 } // namespace interpreter | 58 } // namespace interpreter |
| 54 } // namespace internal | 59 } // namespace internal |
| 55 } // namespace v8 | 60 } // namespace v8 |
| 56 | 61 |
| 57 #endif // V8_INTERPRETER_BYTECODES_H_ | 62 #endif // V8_INTERPRETER_BYTECODES_H_ |
| OLD | NEW |