a88420910d
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. |
||
---|---|---|
.. | ||
c_ast.js | ||
generate_analyzer.js | ||
generate_interpreter.js | ||
generate_jit.js | ||
rust_ast.js | ||
util.js | ||
x86_table.js |