Index: src/interpreter/interpreter.cc |
diff --git a/src/interpreter/interpreter.cc b/src/interpreter/interpreter.cc |
index 1ac342d62b1a4186d5f5643e803d27101abb5a91..4fb2daf4a67af447bdf5c1c36b45aa64106bd2cb 100644 |
--- a/src/interpreter/interpreter.cc |
+++ b/src/interpreter/interpreter.cc |
@@ -53,7 +53,7 @@ Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) { |
} |
void Interpreter::Initialize() { |
- if (IsDispatchTableInitialized()) return; |
+ if (!ShouldInitializeDispatchTable()) return; |
Zone zone(isolate_->allocator(), ZONE_NAME); |
HandleScope scope(isolate_); |
@@ -103,6 +103,9 @@ void Interpreter::Initialize() { |
dispatch_table_[index] = dispatch_table_[illegal_index]; |
} |
} |
+ |
+ // Initialization should have been successful. |
+ DCHECK(IsDispatchTableInitialized()); |
} |
Code* Interpreter::GetBytecodeHandler(Bytecode bytecode, |
@@ -213,13 +216,18 @@ CompilationJob* Interpreter::NewCompilationJob(CompilationInfo* info) { |
} |
bool Interpreter::IsDispatchTableInitialized() { |
+ return dispatch_table_[0] != nullptr; |
+} |
+ |
+bool Interpreter::ShouldInitializeDispatchTable() { |
if (FLAG_trace_ignition || FLAG_trace_ignition_codegen || |
- FLAG_trace_ignition_dispatches) { |
+ FLAG_trace_ignition_dispatches || FLAG_debug_code) { |
// Regenerate table to add bytecode tracing operations, print the assembly |
- // code generated by TurboFan or instrument handlers with dispatch counters. |
- return false; |
+ // code generated by TurboFan, instrument handlers with dispatch counters, |
+ // or insert debugging code into the bytecode handlers. |
+ return true; |
} |
- return dispatch_table_[0] != nullptr; |
+ return !IsDispatchTableInitialized(); |
} |
void Interpreter::TraceCodegen(Handle<Code> code) { |