Skip to content

Commit 6a33399

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 688d01c commit 6a33399

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

common.gypi

+1-1
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.24',
32+
'v8_embedder_string': '-node.25',
3333

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

deps/v8/src/flag-definitions.h

+3
Original file line numberDiff line numberDiff line change
@@ -1211,6 +1211,9 @@ DEFINE_BOOL(log_function_events, false,
12111211
DEFINE_BOOL(prof, false,
12121212
"Log statistical profiling information (implies --log-code).")
12131213

1214+
DEFINE_BOOL(detailed_line_info, true,
1215+
"Always generate detailed line information for CPU profiling.")
1216+
12141217
#if defined(ANDROID)
12151218
// Phones and tablets have processors that are much slower than desktop
12161219
// and laptop computers for which current heuristics are tuned.

deps/v8/src/isolate.cc

+4
Original file line numberDiff line numberDiff line change
@@ -3285,6 +3285,10 @@ bool Isolate::use_optimizer() {
32853285
!is_precise_count_code_coverage() && !is_block_count_code_coverage();
32863286
}
32873287

3288+
bool Isolate::NeedsDetailedOptimizedCodeLineInfo() const {
3289+
return NeedsSourcePositionsForProfiling() || FLAG_detailed_line_info;
3290+
}
3291+
32883292
bool Isolate::NeedsSourcePositionsForProfiling() const {
32893293
return FLAG_trace_deopt || FLAG_trace_turbo || FLAG_trace_turbo_graph ||
32903294
FLAG_turbo_profiling || FLAG_perf_prof || is_profiling() ||

deps/v8/src/isolate.h

+2
Original file line numberDiff line numberDiff line change
@@ -1022,6 +1022,8 @@ class Isolate : private HiddenFactory {
10221022

10231023
bool NeedsSourcePositionsForProfiling() const;
10241024

1025+
bool NeedsDetailedOptimizedCodeLineInfo() const;
1026+
10251027
bool is_best_effort_code_coverage() const {
10261028
return code_coverage_mode() == debug::Coverage::kBestEffort;
10271029
}

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

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

0 commit comments

Comments
 (0)