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

Unified Diff: src/interpreter/interpreter.cc

Issue 1828633003: [Interpreter] Enable tracing of bytecode handler dispatches. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@count-bc
Patch Set: Remove cumulative counters. 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 side-by-side diff with in-line comments
Download patch
Index: src/interpreter/interpreter.cc
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc
index 5084300dfee60294b3af19832d026410b5834c6f..f5c778400220ce3c05d787b191299dc5db52fb5d 100644
--- a/src/interpreter/interpreter.cc
+++ b/src/interpreter/interpreter.cc
@@ -33,6 +33,15 @@ void Interpreter::Initialize() {
Zone zone(isolate_->allocator());
HandleScope scope(isolate_);
+ int kCountersTableRowSize = static_cast<int>(Bytecode::kLast) + 1;
rmcilroy 2016/04/08 11:24:44 nit - move into if below. Also make static const.
Stefano Sanfilippo 2016/04/08 14:42:44 Done.
+
+ if (FLAG_trace_ignition_dispatches) {
+ handler_to_handler_dispatch_counters_.Reset(
+ new uintptr_t[kCountersTableRowSize * kCountersTableRowSize]);
+ memset(handler_to_handler_dispatch_counters_.get(), 0,
+ sizeof(uintptr_t) * kCountersTableRowSize * kCountersTableRowSize);
+ }
+
// Generate bytecode handlers for all bytecodes and scales.
for (OperandScale operand_scale = OperandScale::kSingle;
operand_scale <= OperandScale::kMaxValid;
@@ -148,9 +157,11 @@ bool Interpreter::MakeBytecode(CompilationInfo* info) {
}
bool Interpreter::IsDispatchTableInitialized() {
- if (FLAG_trace_ignition || FLAG_trace_ignition_codegen) {
- // Regenerate table to add bytecode tracing operations
- // or to print the assembly code generated by TurboFan.
+ if (FLAG_trace_ignition || FLAG_trace_ignition_codegen ||
+ FLAG_trace_ignition_dispatches) {
+ // Regenerate table to add bytecode tracing operations,
+ // print the assembly code generated by TurboFan,
+ // or instrument handlers with dispatch counters.
return false;
}
return dispatch_table_[0] != nullptr;

Powered by Google App Engine
This is Rietveld 408576698