Skip to content

Commit 0c0d3ee

Browse files
joyeecheungaduh95
authored andcommitted
deps: V8: cherry-pick c38986131c02
Original commit message: Add V8_DISABLE_PRESERVE_MOST for embedders to opt out of preserve_most preserve_most changes the calling convention, which clang encodes in the mangled name (e.g. "U" instead of "A" for cdecl in the Microsoft C++ ABI). A consumer whose toolchain does not support the attribute would reference a differently mangled symbol. This patch adds a V8_DISABLE_PRESERVE_MOST to disable it, so that it's possible to link to V8 using different toolchains, as long as the value of it is set consistently. Refs: #55784 Change-Id: I67b49e739942d4026ac060be35bb39ec22256cbd Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8532546 Commit-Queue: Joyee Cheung <joyee@igalia.com> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#111381} Refs: v8/v8@c389861 Refs: https://chromium-review.googlesource.com/c/v8/v8/+/8532546 Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: #67093 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com>
1 parent efd0b5a commit 0c0d3ee

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

‎common.gypi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
# Reset this number to 0 on major V8 upgrades.
5252
# Increment by one for each non-official patch applied to deps/v8.
53-
'v8_embedder_string': '-node.10',
53+
'v8_embedder_string': '-node.11',
5454

5555
##### V8 defaults for Node.js #####
5656

‎deps/v8/include/v8config.h‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ path. Add it with -I<path> to the command line
402402
|| ((defined(__AARCH64EL__) || defined(_M_ARM64)) /* arm64, but ... */ \
403403
&& !defined(_WIN32))) /* not on windows */ \
404404
&& !defined(COMPONENT_BUILD) /* no component build */\
405+
&& !defined(V8_DISABLE_PRESERVE_MOST) /* embedder opt-out */ \
405406
&& __clang_major__ >= 17 /* clang >= 17 */
406407
# define V8_HAS_ATTRIBUTE_PRESERVE_MOST (__has_attribute(preserve_most))
407408
#endif
@@ -609,15 +610,11 @@ path. Add it with -I<path> to the command line
609610
// functions.
610611
// Use like:
611612
// V8_NOINLINE V8_PRESERVE_MOST void UnlikelyMethod();
612-
#if V8_CC_MSVC
613-
# define V8_PRESERVE_MOST
614-
#else
615613
#if V8_HAS_ATTRIBUTE_PRESERVE_MOST
616614
# define V8_PRESERVE_MOST __attribute__((preserve_most))
617615
#else
618616
# define V8_PRESERVE_MOST /* NOT SUPPORTED */
619617
#endif
620-
#endif
621618

622619

623620
// A macro (V8_DEPRECATED) to mark classes or functions as deprecated.

0 commit comments

Comments
 (0)