v8/include/v8-wasm-trap-handler-win.h
Andreas Haas a600594d5a [wasm] Implement trap handler on Windows
This is the V8 side of the implementation. You can take a look at a
prototype of the Chrome side changes in https://crrev.com/c/1273043.
Chrome could also use V8's default implementation of the trap handler,
see https://crrev.com/c/1290952.

Bug: v8:6743
Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I9bb3e717db17a4f30bbb8acfd80a1f6510d463ff
Reviewed-on: https://chromium-review.googlesource.com/c/1283111
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57117}
2018-10-30 10:25:37 +00:00

27 lines
967 B
C++

// Copyright 2018 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_WASM_TRAP_HANDLER_WIN_H_
#define V8_WASM_TRAP_HANDLER_WIN_H_
#include <windows.h>
namespace v8 {
/**
* This function determines whether a memory access violation has been an
* out-of-bounds memory access in WebAssembly. If so, it will modify the
* exception parameter and add a return address where the execution can continue
* after the exception handling, and return true. Otherwise the return value
* will be false.
*
* The parameter to this function corresponds to the one passed to a Windows
* vectored exception handler. Use this function only on Windows.
*
* \param exception An EXCEPTION_POINTERS* as provided to the exception handler.
*/
bool TryHandleWebAssemblyTrapWindows(EXCEPTION_POINTERS* exception);
} // namespace v8
#endif // V8_WASM_TRAP_HANDLER_WIN_H_