Skip to content

Commit 3771c9a

Browse files
psmarshalltargos
authored andcommitted
deps: backport detailed line info for CPU profiler
[cpu-profiler] Add flag to always generate accurate line info. https://chromium.googlesource.com/v8/v8/+/ 56baf56790de439b3f69e887e94beb3b301ed77c [cpu-profiler] Turn on detailed line info for optimized code https://chromium.googlesource.com/v8/v8/+/ 84894ce6d2af7feb9e1f5574409355120887326c [cpu-profiler] Separate the flags for generating extra line information https://chromium.googlesource.com/v8/v8/+/ 30ff6719db441cc7ef220d449970cc169067e256 PR-URL: #22688 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent a3f258c commit 3771c9a

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

common.gypi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Reset this number to 0 on major V8 upgrades.
3131
# Increment by one for each non-official patch applied to deps/v8.
32-
'v8_embedder_string': '-node.8',
32+
'v8_embedder_string': '-node.9',
3333

3434
# Enable disassembler for `--print-code` v8 options
3535
'v8_enable_disassembler': 1,

deps/v8/src/flag-definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,6 +1243,9 @@ DEFINE_BOOL(log_function_events, false,
12431243
DEFINE_BOOL(prof, false,
12441244
"Log statistical profiling information (implies --log-code).")
12451245

1246+
DEFINE_BOOL(detailed_line_info, true,
1247+
"Always generate detailed line information for CPU profiling.")
1248+
12461249
#if defined(ANDROID)
12471250
// Phones and tablets have processors that are much slower than desktop
12481251
// and laptop computers for which current heuristics are tuned.

deps/v8/src/isolate.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3247,6 +3247,10 @@ bool Isolate::use_optimizer() {
32473247
!is_precise_count_code_coverage() && !is_block_count_code_coverage();
32483248
}
32493249

3250+
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {
3251+
return NeedsSourcePositionsForProfiling() || FLAG_detailed_line_info;
3252+
}
3253+
32503254
bool Isolate::NeedsSourcePositionsForProfiling() const {
32513255
return FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph ||
32523256
FLAG_turbo_profiling || FLAG_perf_prof || is_profiling() ||

deps/v8/src/isolate.h

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

10451045
bool NeedsSourcePositionsForProfiling() const;
10461046

1047+
bool NeedsDetailedOptimizedCodeLineInfo() const;
1048+
10471049
bool is_best_effort_code_coverage() const {
10481050
return code_coverage_mode() == debug::Coverage::kBestEffort;
10491051
}

deps/v8/src/optimized-compilation-info.cc

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

0 commit comments

Comments
 (0)