Skip to content

Commit c8ff2df

Browse files
committed
deps: V8: cherry-pick b161a0823165
Original commit message: [msvc] implement symbols without inline assembly MSVC does not support inline assembly (clang-cl does). Those two functions needs to be implemented using C++ only. Implemented a version for MSVC only, based on an intrinsic (that guarantees load, even with optimization) available for any architecture. Bug: v8:13312 Change-Id: I3aa4eac03c099535c5d3a9a40221bd5f8bbcb0d1 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913036 Reviewed-by: Jakob Kummerow <[email protected]> Reviewed-by: Thibaud Michaud <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#83407} Refs: v8/v8@b161a08 PR-URL: #44741 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7a8fa2d commit c8ff2df

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.7',
39+
'v8_embedder_string': '-node.8',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/src/trap-handler/handler-outside-simulator.cc

+12
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
#define SYMBOL(name) #name
1212
#endif // !V8_OS_DARWIN
1313

14+
#if defined(_MSC_VER) && !defined(__clang__)
15+
// MSVC does not accept inline assembly
16+
#include <intrin.h>
17+
extern "C" uintptr_t ProbeMemory(uintptr_t address, uintptr_t pc) {
18+
// @pc parameter is unused.
19+
// This intrinsic guarantees that a load from address will be done.
20+
__iso_volatile_load8(reinterpret_cast<char*>(address));
21+
return 0;
22+
}
23+
extern "C" void v8_probe_memory_continuation() {}
24+
#else
1425
// Define the ProbeMemory function declared in trap-handler-simulators.h.
1526
asm(
1627
".globl " SYMBOL(ProbeMemory) " \n"
@@ -35,3 +46,4 @@ asm(
3546
SYMBOL(v8_probe_memory_continuation) ": \n"
3647
// If the trap handler continues here, it wrote the landing pad in %rax.
3748
" ret \n");
49+
#endif

0 commit comments

Comments
 (0)