Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/interpreter/interpreter.h

Issue 1828633003: [Interpreter] Enable tracing of bytecode handler dispatches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@count-bc
Patch Set: Second review. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // Return bytecode handler for |bytecode|. 42 // Return bytecode handler for |bytecode|.
43 Code* GetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale); 43 Code* GetBytecodeHandler(Bytecode bytecode, OperandScale operand_scale);
44 44
45 // GC support. 45 // GC support.
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 void WriteDispatchCounters();
53
52 Address dispatch_table_address() { 54 Address dispatch_table_address() {
53 return reinterpret_cast<Address>(&dispatch_table_[0]); 55 return reinterpret_cast<Address>(&dispatch_table_[0]);
54 } 56 }
55 57
58 uintptr_t* bytecode_dispatch_count_table() {
59 return bytecode_dispatch_count_table_.get();
60 }
61
56 private: 62 private:
57 // Bytecode handler generator functions. 63 // Bytecode handler generator functions.
58 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \ 64 #define DECLARE_BYTECODE_HANDLER_GENERATOR(Name, ...) \
59 void Do##Name(InterpreterAssembler* assembler); 65 void Do##Name(InterpreterAssembler* assembler);
60 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR) 66 BYTECODE_LIST(DECLARE_BYTECODE_HANDLER_GENERATOR)
61 #undef DECLARE_BYTECODE_HANDLER_GENERATOR 67 #undef DECLARE_BYTECODE_HANDLER_GENERATOR
62 68
63 // Generates code to perform the binary operations via |callable|. 69 // Generates code to perform the binary operations via |callable|.
64 void DoBinaryOp(Callable callable, InterpreterAssembler* assembler); 70 void DoBinaryOp(Callable callable, InterpreterAssembler* assembler);
65 71
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 static size_t GetDispatchTableIndex(Bytecode bytecode, 140 static size_t GetDispatchTableIndex(Bytecode bytecode,
135 OperandScale operand_scale); 141 OperandScale operand_scale);
136 142
137 bool IsDispatchTableInitialized(); 143 bool IsDispatchTableInitialized();
138 144
139 static const int kNumberOfWideVariants = 3; 145 static const int kNumberOfWideVariants = 3;
140 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1); 146 static const int kDispatchTableSize = kNumberOfWideVariants * (kMaxUInt8 + 1);
141 147
142 Isolate* isolate_; 148 Isolate* isolate_;
143 Code* dispatch_table_[kDispatchTableSize]; 149 Code* dispatch_table_[kDispatchTableSize];
150 v8::base::SmartArrayPointer<uintptr_t> bytecode_dispatch_count_table_;
144 151
145 DISALLOW_COPY_AND_ASSIGN(Interpreter); 152 DISALLOW_COPY_AND_ASSIGN(Interpreter);
146 }; 153 };
147 154
148 } // namespace interpreter 155 } // namespace interpreter
149 } // namespace internal 156 } // namespace internal
150 } // namespace v8 157 } // namespace v8
151 158
152 #endif // V8_INTERPRETER_INTERPRETER_H_ 159 #endif // V8_INTERPRETER_INTERPRETER_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/interpreter/interpreter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698