5 #ifndef V8_INTERPRETER_INTERPRETER_H_ 6 #define V8_INTERPRETER_INTERPRETER_H_ 13 #include "src/base/macros.h" 14 #include "src/builtins/builtins.h" 15 #include "src/interpreter/bytecodes.h" 16 #include "src/runtime/runtime.h" 23 class UnoptimizedCompilationJob;
24 class FunctionLiteral;
27 class SetupIsolateDelegate;
31 namespace interpreter {
33 class InterpreterAssembler;
41 static int InterruptBudget();
49 std::vector<FunctionLiteral*>* eager_inner_literals);
53 Code GetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale);
56 void SetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale,
63 const char* LookupNameOfBytecodeHandler(
const Code code);
67 void ForEachBytecode(
const std::function<
void(Bytecode, OperandScale)>& f);
71 bool IsDispatchTableInitialized()
const;
73 Address dispatch_table_address() {
74 return reinterpret_cast<Address>(&dispatch_table_[0]);
77 Address bytecode_dispatch_counters_table() {
78 return reinterpret_cast<Address>(bytecode_dispatch_counters_table_.get());
81 Address address_of_interpreter_entry_trampoline_instruction_start()
const {
82 return reinterpret_cast<Address>(
83 &interpreter_entry_trampoline_instruction_start_);
87 friend class SetupInterpreter;
90 uintptr_t GetDispatchCounter(Bytecode from, Bytecode to)
const;
93 static size_t GetDispatchTableIndex(Bytecode bytecode,
94 OperandScale operand_scale);
96 static const int kNumberOfWideVariants = BytecodeOperands::kOperandScaleCount;
97 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1);
98 static const int kNumberOfBytecodes =
static_cast<int>(Bytecode::kLast) + 1;
101 Address dispatch_table_[kDispatchTableSize];
102 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_;
103 Address interpreter_entry_trampoline_instruction_start_;
112 #endif // V8_INTERPRETER_INTERPRETER_H_