#include "src/trap-handler/handler-inside-posix.h"
#include <signal.h>
#if defined(V8_OS_LINUX) || defined(V8_OS_FREEBSD)
#include <ucontext.h>
#elif V8_OS_DARWIN
#include <sys/ucontext.h>
#endif
#include <stddef.h>
#include <stdlib.h>
#include "src/trap-handler/trap-handler-internal.h"
#include "src/trap-handler/trap-handler.h"
#ifdef V8_TRAP_HANDLER_VIA_SIMULATOR
#include "src/trap-handler/trap-handler-simulator.h"
#endif
namespace v8 {
namespace internal {
namespace trap_handler {
#if V8_TRAP_HANDLER_SUPPORTED
#if V8_OS_LINUX && V8_HOST_ARCH_ARM64
#define CONTEXT_REG …
#elif V8_OS_LINUX && (V8_HOST_ARCH_LOONG64 || V8_HOST_ARCH_RISCV64)
#define CONTEXT_REG …
#elif V8_OS_LINUX
#define CONTEXT_REG(reg, REG) …
#elif V8_OS_DARWIN && V8_HOST_ARCH_ARM64
#define CONTEXT_REG …
#elif V8_OS_DARWIN
#define CONTEXT_REG …
#elif V8_OS_FREEBSD
#define CONTEXT_REG …
#else
#error "Unsupported platform."
#endif
#if V8_OS_LINUX && V8_HOST_ARCH_ARM64
#define CONTEXT_PC …
#elif V8_OS_DARWIN && V8_HOST_ARCH_ARM64
#define CONTEXT_PC …
#elif V8_OS_LINUX && V8_HOST_ARCH_LOONG64
#define CONTEXT_PC …
#elif V8_OS_LINUX && V8_HOST_ARCH_RISCV64
#define CONTEXT_PC …
#endif
bool IsKernelGeneratedSignal(siginfo_t* info) { … }
class UnmaskOobSignalScope { … };
#ifdef V8_TRAP_HANDLER_VIA_SIMULATOR
extern char probe_memory_continuation[]
#if V8_OS_DARWIN
asm("_v8_simulator_probe_memory_continuation");
#else
asm("v8_simulator_probe_memory_continuation");
#endif
#endif
bool TryHandleSignal(int signum, siginfo_t* info, void* context) { … }
void HandleSignal(int signum, siginfo_t* info, void* context) { … }
#endif
}
}
}