Index: src/compilation-info.cc |
diff --git a/src/compilation-info.cc b/src/compilation-info.cc |
index 5c9fa5836734983a2463a05abbd85e3105373131..564ac31f750046cba3e8b5ed083f7e397941a11d 100644 |
--- a/src/compilation-info.cc |
+++ b/src/compilation-info.cc |
@@ -7,6 +7,7 @@ |
#include "src/api.h" |
#include "src/ast/ast.h" |
#include "src/ast/scopes.h" |
+#include "src/debug/debug.h" |
#include "src/isolate.h" |
#include "src/parsing/parse-info.h" |
#include "src/source-position.h" |
@@ -68,8 +69,12 @@ CompilationInfo::CompilationInfo(ParseInfo* parse_info, |
if (FLAG_function_context_specialization) MarkAsFunctionContextSpecializing(); |
if (FLAG_turbo_splitting) MarkAsSplittingEnabled(); |
+ // Collect source positions for optimized code when profiling or if debugger |
+ // is active, to be able to get more precise source positions at the price of |
+ // more memory consumption. |
if (FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph || |
- FLAG_turbo_profiling || isolate_->is_profiling()) { |
+ FLAG_turbo_profiling || isolate_->is_profiling() || |
+ isolate_->debug()->is_active()) { |
MarkAsSourcePositionsEnabled(); |
} |
} |