Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: V8: backport detailed line information for the CPU profiler #22688

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.26',
'v8_embedder_string': '-node.27',

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
Expand Down
3 changes: 3 additions & 0 deletions deps/v8/src/flag-definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,9 @@ DEFINE_BOOL(log_function_events, false,
DEFINE_BOOL(prof, false,
"Log statistical profiling information (implies --log-code).")

DEFINE_BOOL(detailed_line_info, true,
"Always generate detailed line information for CPU profiling.")

#if defined(ANDROID)
// Phones and tablets have processors that are much slower than desktop
// and laptop computers for which current heuristics are tuned.
Expand Down
4 changes: 4 additions & 0 deletions deps/v8/src/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3285,6 +3285,10 @@ 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() ||
Expand Down
2 changes: 2 additions & 0 deletions deps/v8/src/isolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,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;
}
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/optimized-compilation-info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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();
}

Expand Down