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

Unified Diff: src/interpreter/interpreter.cc

Issue 2443923002: [interpreter] Ensure --debug-code works with snapshots. (Closed)
Patch Set: Addressed comment. Created 4 years, 2 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
« no previous file with comments | « src/interpreter/interpreter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/interpreter/interpreter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698