From 39d3b1d1a09fe363bf7497ec917d8dc5880e8f89 Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Sun, 6 Sep 2026 18:57:56 +0000 Subject: [PATCH] deps: V8: cherry-pick 5404e0f85a83 Original commit message: [cppgc] Use _AddressOfReturnAddress() for StackStartMarker under MSVC include/cppgc/heap.h is a public header, and since b3cb54c7e65 ("[heap] Add StackStartMarker for cppgc") it calls __builtin_frame_address(0) unconditionally. That builtin does not exist in MSVC, so any translation unit built with cl.exe that includes the header (directly or through v8-cppgc.h) fails to compile, even if it never constructs a StackStartMarker. Use _AddressOfReturnAddress() when V8_CC_MSVC is set, which is what base::Stack::GetCurrentStackPosition() already does for the same purpose, and keep __builtin_frame_address(0) elsewhere. Bug: none Change-Id: Icd4c0238cb277c8e1b73454534ffb2519b302ce9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8361192 Reviewed-by: Omer Katz Reviewed-by: Camillo Bruni Commit-Queue: Shelley Vohr Cr-Commit-Position: refs/heads/main@{#109737} Refs: https://github.com/v8/v8/commit/5404e0f85a8313b0ef8342d3081c008714b7fdb9 Signed-off-by: Joyee Cheung PR-URL: https://github.com/nodejs/node/pull/65161 Reviewed-By: Antoine du Hamel Reviewed-By: Richard Lau --- common.gypi | 2 +- deps/v8/AUTHORS | 1 + deps/v8/include/cppgc/heap.h | 8 ++++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index 162e549e980..88e26799d8b 100644 --- a/common.gypi +++ b/common.gypi @@ -44,7 +44,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.17', + 'v8_embedder_string': '-node.18', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 331de3a3923..0b440374225 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -295,6 +295,7 @@ Seo Sanghyeon Sergey Markelov Shawn Anastasio Shawn Presser +Shelley Vohr Sho Miyamoto Shumaf Lovpache Stefan Penner diff --git a/deps/v8/include/cppgc/heap.h b/deps/v8/include/cppgc/heap.h index 2968a0af197..77673be7d73 100644 --- a/deps/v8/include/cppgc/heap.h +++ b/deps/v8/include/cppgc/heap.h @@ -15,6 +15,10 @@ #include "cppgc/platform.h" #include "v8config.h" // NOLINT(build/include_directory) +#if V8_CC_MSVC +#include // _AddressOfReturnAddress() +#endif + /** * cppgc - A C++ garbage collection library. */ @@ -37,7 +41,11 @@ class Heap; */ class V8_EXPORT StackStartMarker { public: +#if V8_CC_MSVC + StackStartMarker() : stack_start_(_AddressOfReturnAddress()) {} +#else StackStartMarker() : stack_start_(__builtin_frame_address(0)) {} +#endif void* stack_start() const { return stack_start_; } private: