Commit 30ff6719 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cpu-profiler] Separate the flags for generating extra line information

NeedsSourcePositionsForProfiling is used to control the generation of
the line end table during parsing (see ParseInfo::CreateScript). This
is costly both for memory and performance. Turning on detailed_line_info
by default caused regressions because we always generate the line end
table.

This CL splits the two conditions apart as they aren't related.

Bug: chromium:875677
Change-Id: I71006db586e504b4cf9232081ba249f5647f5b76
Reviewed-on: https://chromium-review.googlesource.com/1181041Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55222}
parent 60408d97
......@@ -3248,11 +3248,14 @@ bool Isolate::use_optimizer() {
!is_precise_count_code_coverage() && !is_block_count_code_coverage();
}
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {
return NeedsSourcePositionsForProfiling() || FLAG_detailed_line_info;
}
bool Isolate::NeedsSourcePositionsForProfiling() const {
return FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph ||
FLAG_turbo_profiling || FLAG_perf_prof || is_profiling() ||
debug_->is_active() || logger_->is_logging() || FLAG_trace_maps ||
FLAG_detailed_line_info;
debug_->is_active() || logger_->is_logging() || FLAG_trace_maps;
}
void Isolate::SetFeedbackVectorsForProfilingTools(Object* value) {
......
......@@ -1141,6 +1141,8 @@ class Isolate : private HiddenFactory {
bool NeedsSourcePositionsForProfiling() const;
bool NeedsDetailedOptimizedCodeLineInfo() const;
bool is_best_effort_code_coverage() const {
return code_coverage_mode() == debug::Coverage::kBestEffort;
}
......
......@@ -36,7 +36,7 @@ OptimizedCompilationInfo::OptimizedCompilationInfo(
// 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 (isolate->NeedsSourcePositionsForProfiling()) {
if (isolate->NeedsDetailedOptimizedCodeLineInfo()) {
MarkAsSourcePositionsEnabled();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment