diff options
author | Peter Marshall <p.s.marshall0@gmail.com> | 2018-09-04 16:48:15 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-09-07 09:57:42 +0300 |
commit | ba87c7ce7d3c0ebfa0c94b6188b2af8b2149aca6 (patch) | |
tree | fd33d999bc97a364054392fa46d4afebfa89bfd3 /deps | |
parent | e917a23d2e8269eec48e95bcebcb9f7c6c5e4e3d (diff) |
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: https://github.com/nodejs/node/pull/22688
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/src/flag-definitions.h | 3 | ||||
-rw-r--r-- | deps/v8/src/isolate.cc | 4 | ||||
-rw-r--r-- | deps/v8/src/isolate.h | 2 | ||||
-rw-r--r-- | deps/v8/src/optimized-compilation-info.cc | 2 |
4 files changed, 10 insertions, 1 deletions
diff --git a/deps/v8/src/flag-definitions.h b/deps/v8/src/flag-definitions.h index f5d724c8e9c..e8226006df4 100644 --- a/deps/v8/src/flag-definitions.h +++ b/deps/v8/src/flag-definitions.h @@ -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. diff --git a/deps/v8/src/isolate.cc b/deps/v8/src/isolate.cc index 0e457df4d1a..bb50ae493d5 100644 --- a/deps/v8/src/isolate.cc +++ b/deps/v8/src/isolate.cc @@ -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() || diff --git a/deps/v8/src/isolate.h b/deps/v8/src/isolate.h index 69ec1f18531..672bfef6359 100644 --- a/deps/v8/src/isolate.h +++ b/deps/v8/src/isolate.h @@ -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; } diff --git a/deps/v8/src/optimized-compilation-info.cc b/deps/v8/src/optimized-compilation-info.cc index c20ba677fca..dc932a1c041 100644 --- a/deps/v8/src/optimized-compilation-info.cc +++ b/deps/v8/src/optimized-compilation-info.cc @@ -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(); } |