Skip to content

Add “try-load” and “try-store” instructions #23

@pcwalton

Description

@pcwalton

JITting emulators like http://copy.sh/v86 incur significant overhead from having to check page tables on every memory access. Traditionally, emulators implement this by trapping SIGSEGV. The signal handler isn’t necessary, however. One could imagine a “try load” and “try store” pair of instructions that take a block of code to execute if the load would otherwise trap. A simple implementation of WebAssembly could emit a compare against the page protections and jump. A more optimizing implementation could catch the SIGSEGV and alter the wasm program counter.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions