mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
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 <omerkatz@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Shelley Vohr <shelley.vohr@gmail.com>
Cr-Commit-Position: refs/heads/main@{#109737}
Refs: https://github.com/v8/v8/commit/5404e0f85a8313b0ef8342d3081c008714b7fdb9
Signed-off-by: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/65161
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
This commit is contained in:
1 parent
5d221d9cd6
commit
39d3b1d1a0
3 files changed
+10
-1
No files matched your search
+1
-1
@@ -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 #####
|
||||
|
||||
|
||||
Vendored
+1
@@ -295,6 +295,7 @@ Seo Sanghyeon <sanxiyn@gmail.com>
|
||||
Sergey Markelov <sergionso@gmail.com>
|
||||
Shawn Anastasio <shawnanastasio@gmail.com>
|
||||
Shawn Presser <shawnpresser@gmail.com>
|
||||
Shelley Vohr <shelley.vohr@gmail.com>
|
||||
Sho Miyamoto <me@shqld.dev>
|
||||
Shumaf Lovpache <soarex16@gmail.com>
|
||||
Stefan Penner <stefan.penner@gmail.com>
|
||||
|
||||
Vendored
+8
@@ -15,6 +15,10 @@
|
||||
#include "cppgc/platform.h"
|
||||
#include "v8config.h" // NOLINT(build/include_directory)
|
||||
|
||||
#if V8_CC_MSVC
|
||||
#include <intrin.h> // _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:
|
||||
|
||||
Reference in new issue
Block a user