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 #include <memory> | 8 #include <memory> |
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 compiler::Node* BuildUnaryOp(Callable callable, | 168 compiler::Node* BuildUnaryOp(Callable callable, |
169 InterpreterAssembler* assembler); | 169 InterpreterAssembler* assembler); |
170 | 170 |
171 uintptr_t GetDispatchCounter(Bytecode from, Bytecode to) const; | 171 uintptr_t GetDispatchCounter(Bytecode from, Bytecode to) const; |
172 | 172 |
173 // Get dispatch table index of bytecode. | 173 // Get dispatch table index of bytecode. |
174 static size_t GetDispatchTableIndex(Bytecode bytecode, | 174 static size_t GetDispatchTableIndex(Bytecode bytecode, |
175 OperandScale operand_scale); | 175 OperandScale operand_scale); |
176 | 176 |
177 bool IsDispatchTableInitialized(); | 177 bool IsDispatchTableInitialized(); |
| 178 bool ShouldInitializeDispatchTable(); |
178 | 179 |
179 static const int kNumberOfWideVariants = 3; | 180 static const int kNumberOfWideVariants = 3; |
180 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); | 181 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); |
181 static const int kNumberOfBytecodes = static_cast<int>(Bytecode::kLast) + 1; | 182 static const int kNumberOfBytecodes = static_cast<int>(Bytecode::kLast) + 1; |
182 | 183 |
183 Isolate* isolate_; | 184 Isolate* isolate_; |
184 Address dispatch_table_[kDispatchTableSize]; | 185 Address dispatch_table_[kDispatchTableSize]; |
185 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_; | 186 std::unique_ptr<uintptr_t[]> bytecode_dispatch_counters_table_; |
186 | 187 |
187 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 188 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
188 }; | 189 }; |
189 | 190 |
190 } // namespace interpreter | 191 } // namespace interpreter |
191 } // namespace internal | 192 } // namespace internal |
192 } // namespace v8 | 193 } // namespace v8 |
193 | 194 |
194 #endif // V8_INTERPRETER_INTERPRETER_H_ | 195 #endif // V8_INTERPRETER_INTERPRETER_H_ |
OLD | NEW |