v86/gen
Fabian a88420910d Handle pagefaults without JS exceptions
This commit makes the return type of most basic memory access primitives
Result, where the Err(()) case means a page fault happened, the
instruction should be aborted and execution should continue at the page
fault handler.

The following primites have a Result return type: safe_{read,write}*,
translate_address_*, read_imm*, writable_or_pagefault, get_phys_eip,
modrm_resolve, push*, pop*.

Any instruction needs to handle the page fault cases and abort
execution appropriately. The return_on_pagefault! macro has been
provided to get the same behaviour as the previously used JS exceptions
(local to the function).

Calls from JavaScript abort on a pagefault, except for
writable_or_pagefault, which returns a boolean. JS needs to check
before calling any function that may pagefault.

This commit does not yet pervasively apply return_on_pagefault!, this
will be added in the next commit.

Jitted code does not yet properly handle the new form of page faults,
this will be added in a later commit.
2020-08-30 19:29:53 -05:00
..
c_ast.js Squash 2020-07-21 20:10:12 -05:00
generate_analyzer.js Generate prefix handling for string instructions 2020-08-30 19:29:13 -05:00
generate_interpreter.js Handle pagefaults without JS exceptions 2020-08-30 19:29:53 -05:00
generate_jit.js Remove use of raising cpu exceptions for trigger_ud 2020-08-30 19:29:53 -05:00
rust_ast.js Port jit to Rust 2020-08-30 19:29:13 -05:00
util.js Port jit to Rust 2020-08-30 19:29:13 -05:00
x86_table.js Handle pagefaults without JS exceptions 2020-08-30 19:29:53 -05:00