Skip to content

Commit 30ff671

Browse files
psmarshallCommit Bot
authored andcommitted
[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/1181041 Reviewed-by: Tobias Tebbi <[email protected]> Commit-Queue: Peter Marshall <[email protected]> Cr-Commit-Position: refs/heads/master@{#55222}
1 parent 60408d9 commit 30ff671

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

src/isolate.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3248,11 +3248,14 @@ bool Isolate::use_optimizer() {
32483248
!is_precise_count_code_coverage() && !is_block_count_code_coverage();
32493249
}
32503250

3251+
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {
3252+
return NeedsSourcePositionsForProfiling() || FLAG_detailed_line_info;
3253+
}
3254+
32513255
bool Isolate::NeedsSourcePositionsForProfiling() const {
32523256
return FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph ||
32533257
FLAG_turbo_profiling || FLAG_perf_prof || is_profiling() ||
3254-
debug_->is_active() || logger_->is_logging() || FLAG_trace_maps ||
3255-
FLAG_detailed_line_info;
3258+
debug_->is_active() || logger_->is_logging() || FLAG_trace_maps;
32563259
}
32573260

32583261
void Isolate::SetFeedbackVectorsForProfilingTools(Object* value) {

src/isolate.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,8 @@ class Isolate : private HiddenFactory {
11411141

11421142
bool NeedsSourcePositionsForProfiling() const;
11431143

1144+
bool NeedsDetailedOptimizedCodeLineInfo() const;
1145+
11441146
bool is_best_effort_code_coverage() const {
11451147
return code_coverage_mode() == debug::Coverage::kBestEffort;
11461148
}

src/optimized-compilation-info.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ OptimizedCompilationInfo::OptimizedCompilationInfo(
3636
// Collect source positions for optimized code when profiling or if debugger
3737
// is active, to be able to get more precise source positions at the price of
3838
// more memory consumption.
39-
if (isolate->NeedsSourcePositionsForProfiling()) {
39+
if (isolate->NeedsDetailedOptimizedCodeLineInfo()) {
4040
MarkAsSourcePositionsEnabled();
4141
}
4242

0 commit comments

Comments
 (0)