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 uint32_t* handlers_dispatch_counters() { | |
57 return &handlers_dispatch_counters_[0]; | |
58 } | |
59 | |
56 // Returns true if a handler is generated for a bytecode at a given | 60 // Returns true if a handler is generated for a bytecode at a given |
57 // operand scale. | 61 // operand scale. |
58 static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale); | 62 static bool BytecodeHasHandler(Bytecode bytecode, OperandScale operand_scale); |
59 | 63 |
60 private: | 64 private: |
61 // Bytecode handler generator functions. | 65 // Bytecode handler generator functions. |
62 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ | 66 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ |
63 void Do##Name(InterpreterAssembler* assembler); | 67 void Do##Name(InterpreterAssembler* assembler); |
64 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) | 68 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) |
65 #undef DECLARE_BYTECODE_HANDLER_GENERATOR | 69 #undef DECLARE_BYTECODE_HANDLER_GENERATOR |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 static size_t GetDispatchTableIndex(Bytecode bytecode, | 142 static size_t GetDispatchTableIndex(Bytecode bytecode, |
139 OperandScale operand_scale); | 143 OperandScale operand_scale); |
140 | 144 |
141 bool IsDispatchTableInitialized(); | 145 bool IsDispatchTableInitialized(); |
142 | 146 |
143 static const int kNumberOfWideVariants = 3; | 147 static const int kNumberOfWideVariants = 3; |
144 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); | 148 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); |
145 | 149 |
146 Isolate* isolate_; | 150 Isolate* isolate_; |
147 Code* dispatch_table_[kDispatchTableSize]; | 151 Code* dispatch_table_[kDispatchTableSize]; |
152 uint32_t handlers_dispatch_counters_[kDispatchTableSize]; | |
rmcilroy
2016/03/23 11:04:26
Do we need the 3x size of the dispatch table, or d
Stefano Sanfilippo
2016/03/23 16:26:27
I have created a new kCountersTableRowSize constan
| |
148 | 153 |
149 DISALLOW_COPY_AND_ASSIGN(Interpreter); | 154 DISALLOW_COPY_AND_ASSIGN(Interpreter); |
150 }; | 155 }; |
151 | 156 |
152 } // namespace interpreter | 157 } // namespace interpreter |
153 } // namespace internal | 158 } // namespace internal |
154 } // namespace v8 | 159 } // namespace v8 |
155 | 160 |
156 #endif // V8_INTERPRETER_INTERPRETER_H_ | 161 #endif // V8_INTERPRETER_INTERPRETER_H_ |
OLD | NEW |