* Remove the `jit_function_registry` global state This commit removes on the final pieces of global state in wasmtime today, the `jit_function_registry` module. The purpose of this module is to help translate a native backtrace with native program counters into a wasm backtrace with module names, function names, and wasm module indices. To that end this module retained a global map of function ranges to this metadata information for each compiled function. It turns out that we already had a `NAMES` global in the `wasmtime` crate for symbolicating backtrace addresses, so this commit moves that global into its own file and restructures the internals to account for program counter ranges as well. The general set of changes here are: * Remove `jit_function_registry` * Remove `NAMES` * Create a new `frame_info` module which has a singleton global registering compiled module's frame information. * Update traps to use the `frame_info` module to symbolicate pcs, directly extracting a `FrameInfo` from the module. * Register and unregister information on a module level instead of on a per-function level (at least in terms of locking granluarity). This commit leaves the new `FRAME_INFO` global variable as the only remaining "critical" global variable in `wasmtime`, which only exists due to the API of `Trap` where it doesn't take in any extra context when capturing a stack trace through which we could hang off frame information. I'm thinking though that this is ok, and we can always tweak the API of `Trap` in the future if necessary if we truly need to accomodate this. * Remove a lazy_static dep * Add some comments and restructure
Wasmtime Embedding API
The wasmtime crate is an embedding API of the wasmtime WebAssembly runtime.
This is intended to be used in Rust projects and provides a high-level API of
working with WebAssembly modules.
If you're interested in embedding wasmtime in other languages, you may wish to
take a look a the C embedding API instead!