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_INTERPRETER_H_ | 5 #ifndef V8_INTERPRETER_INTERPRETER_H_ |
6 #define V8_INTERPRETER_INTERPRETER_H_ | 6 #define V8_INTERPRETER_INTERPRETER_H_ |
7 | 7 |
8 // Clients of this interface shouldn't depend on lots of interpreter internals. | 8 // Clients of this interface shouldn't depend on lots of interpreter internals. |
9 // Do not include anything from src/interpreter other than | 9 // Do not include anything from src/interpreter other than |
10 // src/interpreter/bytecodes.h here! | 10 // src/interpreter/bytecodes.h here! |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 void IterateDispatchTable(ObjectVisitor* v); | 46 void IterateDispatchTable(ObjectVisitor* v); |
47 | 47 |
48 // Disassembler support (only useful with ENABLE_DISASSEMBLER defined). | 48 // Disassembler support (only useful with ENABLE_DISASSEMBLER defined). |
49 void TraceCodegen(Handle<Code> code); | 49 void TraceCodegen(Handle<Code> code); |
50 const char* LookupNameOfBytecodeHandler(Code* code); | 50 const char* LookupNameOfBytecodeHandler(Code* code); |
51 | 51 |
52 Address dispatch_table_address() { | 52 Address dispatch_table_address() { |
53 return reinterpret_cast<Address>(&dispatch_table_[0]); | 53 return reinterpret_cast<Address>(&dispatch_table_[0]); |
54 } | 54 } |
55 | 55 |
| 56 uintptr_t* bytecode_dispatch_count_table() { |
| 57 return bytecode_dispatch_count_table_.get(); |
| 58 } |
| 59 |
56 private: | 60 private: |
57 // Bytecode handler generator functions. | 61 // Bytecode handler generator functions. |
58 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ | 62 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ |
59 void Do##Name(InterpreterAssembler* assembler); | 63 void Do##Name(InterpreterAssembler* assembler); |
60 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) | 64 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) |
61 #undef DECLARE_BYTECODE_HANDLER_GENERATOR | 65 #undef DECLARE_BYTECODE_HANDLER_GENERATOR |
62 | 66 |
63 // Generates code to perform the binary operations via |callable|. | 67 // Generates code to perform the binary operations via |callable|. |
64 void DoBinaryOp(Callable callable, InterpreterAssembler* assembler); | 68 void DoBinaryOp(Callable callable, InterpreterAssembler* assembler); |
65 | 69 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 static size_t GetDispatchTableIndex(Bytecode bytecode, | 138 static size_t GetDispatchTableIndex(Bytecode bytecode, |
135 OperandScale operand_scale); | 139 OperandScale operand_scale); |
136 | 140 |
137 bool IsDispatchTableInitialized(); | 141 bool IsDispatchTableInitialized(); |
138 | 142 |
139 static const int kNumberOfWideVariants = 3; | 143 static const int kNumberOfWideVariants = 3; |
140 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); | 144 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); |
141 | 145 |
142 Isolate* isolate_; | 146 Isolate* isolate_; |
143 Code* dispatch_table_[kDispatchTableSize]; | 147 Code* dispatch_table_[kDispatchTableSize]; |
| 148 v8::base::SmartArrayPointer<uintptr_t> bytecode_dispatch_count_table_; |
144 | 149 |
145 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 150 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
146 }; | 151 }; |
147 | 152 |
148 } // namespace interpreter | 153 } // namespace interpreter |
149 } // namespace internal | 154 } // namespace internal |
150 } // namespace v8 | 155 } // namespace v8 |
151 | 156 |
152 #endif // V8_INTERPRETER_INTERPRETER_H_ | 157 #endif // V8_INTERPRETER_INTERPRETER_H_ |
OLD | NEW |