Chromium Code Reviews| Index: src/interpreter/interpreter.cc |
| diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
| index 5084300dfee60294b3af19832d026410b5834c6f..327b4b5caa44bc5c58ea8ee3fd54be9932ddb29a 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_); |
| + if (FLAG_trace_ignition_dispatches) { |
| + static const int kCountersTableRowSize = |
|
rmcilroy
2016/04/08 16:40:31
kBytecodeCount would be a more appropriate name (g
Stefano Sanfilippo
2016/04/08 17:01:05
I second this proposal, however I fill it qualifie
rmcilroy
2016/04/08 17:15:47
Sure.
|
| + static_cast<int>(Bytecode::kLast) + 1; |
| + bytecode_dispatch_count_table_.Reset( |
| + new uintptr_t[kCountersTableRowSize * kCountersTableRowSize]); |
| + memset(bytecode_dispatch_count_table_.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; |