Commit b161a082 authored by Pierrick Bouvier's avatar Pierrick Bouvier Committed by V8 LUCI CQ

[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/+/3913036Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Reviewed-by: 's avatarThibaud Michaud <thibaudm@chromium.org>
Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83407}
parent 7ddb8399
......@@ -11,6 +11,17 @@
#define SYMBOL(name) #name
#endif // !V8_OS_DARWIN
#if defined(_MSC_VER) && !defined(__clang__)
// MSVC does not accept inline assembly
#include <intrin.h>
extern "C" uintptr_t ProbeMemory(uintptr_t address, uintptr_t pc) {
// @pc parameter is unused.
// This intrinsic guarantees that a load from address will be done.
__iso_volatile_load8(reinterpret_cast<char*>(address));
return 0;
}
extern "C" void v8_probe_memory_continuation() {}
#else
// Define the ProbeMemory function declared in trap-handler-simulators.h.
asm(
".globl " SYMBOL(ProbeMemory) " \n"
......@@ -35,3 +46,4 @@ asm(
SYMBOL(v8_probe_memory_continuation) ": \n"
// If the trap handler continues here, it wrote the landing pad in %rax.
" ret \n");
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment