Implement wasm trap handlers. (#27)

* Implement wasm trap handlers.

This adds signal handlers based on SpiderMonkey's signal-handler code.
The functionality for looking up the trap code and wasm bytecode offset
isn't yet implemented, but this is a start.

I considered rewriting this code in Rust, but decided against it for now
as C++ allows us to talk to the relevant OS APIs more directly.

Fixes #15.

* Compile with -std=c++11.

* Refactor InstallState initialization.

* Compile with -fPIC.

* Factor out the code for calling a wasm function with a given index.

* Fix unclear wording in a comment.
This commit is contained in:
Dan Gohman
2018-11-27 06:05:58 -08:00
committed by GitHub
parent 8e1e75f1f4
commit 35627cf37f
9 changed files with 1132 additions and 19 deletions

View File

@@ -13,9 +13,16 @@ readme = "README.md"
cranelift-codegen = "0.25.0"
cranelift-entity = "0.25.0"
cranelift-wasm = "0.25.0"
region = "1.0.0"
wasmtime-environ = { path = "../environ" }
region = "1.0.0"
memmap = "0.7.0"
lazy_static = "1.2.0"
libc = "0.2.44"
[build-dependencies]
cmake = "0.1.35"
bindgen = "0.43.2"
regex = "1.0.6"
[features]
default = ["std"]