From 5f852cc9fe10198e730a9e7c13a1133ba3fd131b Mon Sep 17 00:00:00 2001 From: Luke Albao Date: Mon, 23 Oct 2023 08:27:33 -0700 Subject: [PATCH] deps: V8: cherry-pick f7d000a7ae7b MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: [logging] Bugfix: LinuxPerfBasicLogger should log JS functions This patch fixes a typo that was introduced in commit c51041f45400928cd64fbc8f389c0dd0dd15f82f / https://chromium-review.googlesource.com/c/v8/v8/+/2336793, which reversed the behavior of the perf_basic_prof_only_functions flag. This also refactors the equivalent guard in LinuxPerfJitLogger to use the same inline CodeKind API for identifying JS Functions. This is unrelated to the bug, but it seems a fair rider to add on here. Bug: v8:14387 Change-Id: I25766b0d45f4c65dfec5ae01e094a1ed94111054 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4954225 Reviewed-by: Camillo Bruni Commit-Queue: Camillo Bruni Cr-Commit-Position: refs/heads/main@{#90501} Refs: https://github.com/v8/v8/commit/f7d000a7ae7b731805338338eb51a81fbcfe2628 PR-URL: https://github.com/nodejs/node/pull/50344 Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau --- common.gypi | 2 +- deps/v8/AUTHORS | 1 + deps/v8/src/diagnostics/perf-jit.cc | 7 ++----- deps/v8/src/logging/log.cc | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/common.gypi b/common.gypi index 94fae065189043..36bfa41701aef3 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,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', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index d827b95979057e..92d440ef19635b 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -159,6 +159,7 @@ Kyounga Ra Loo Rong Jie Lu Yahan Luis Reis +Luke Albao Luke Zarko Ma Aiguo Maciej Małecki diff --git a/deps/v8/src/diagnostics/perf-jit.cc b/deps/v8/src/diagnostics/perf-jit.cc index d222c11336f417..c2399046a92144 100644 --- a/deps/v8/src/diagnostics/perf-jit.cc +++ b/deps/v8/src/diagnostics/perf-jit.cc @@ -42,6 +42,7 @@ #include "src/codegen/assembler.h" #include "src/codegen/source-position-table.h" #include "src/diagnostics/eh-frame.h" +#include "src/objects/code-kind.h" #include "src/objects/objects-inl.h" #include "src/objects/shared-function-info.h" #include "src/snapshot/embedded/embedded-data.h" @@ -214,11 +215,7 @@ void PerfJitLogger::LogRecordedBuffer( Handle abstract_code, MaybeHandle maybe_shared, const char* name, int length) { - if (FLAG_perf_basic_prof_only_functions && - (abstract_code->kind() != CodeKind::INTERPRETED_FUNCTION && - abstract_code->kind() != CodeKind::TURBOFAN && - abstract_code->kind() != CodeKind::MAGLEV && - abstract_code->kind() != CodeKind::BASELINE)) { + if (FLAG_perf_basic_prof_only_functions && !CodeKindIsJSFunction(abstract_code->kind())) { return; } diff --git a/deps/v8/src/logging/log.cc b/deps/v8/src/logging/log.cc index e2de9db07cd3ea..8a640ac273220d 100644 --- a/deps/v8/src/logging/log.cc +++ b/deps/v8/src/logging/log.cc @@ -364,7 +364,7 @@ void PerfBasicLogger::LogRecordedBuffer(Handle code, MaybeHandle, const char* name, int length) { if (FLAG_perf_basic_prof_only_functions && - CodeKindIsBuiltinOrJSFunction(code->kind())) { + !CodeKindIsBuiltinOrJSFunction(code->kind())) { return; }