Improve panics/traps from imported functions (#857)
* Improve panics/traps from imported functions This commit performs a few refactorings and fixes a bug as well. The changes here are: * The `thread_local!` in the `wasmtime` crate for trap information is removed. The thread local in the `wasmtime_runtime` crate is now leveraged to transmit trap information. * Panics in user-provided functions are now caught explicitly to be carried across JIT code manually. Getting Rust panics unwinding through JIT code is pretty likely to be super tricky and difficult to do, so in the meantime we can get by with catching panics and resuming the panic once we've resumed in Rust code. * Various take/record trap apis have all been removed in favor of working directly with `Trap` objects, where the internal trap object has been expanded slightly to encompass user-provided errors as well. This borrows a bit #839 and otherwise will... Closes #848 * Rename `r#return` to `ret`
This commit is contained in:
@@ -44,7 +44,8 @@ pub use crate::jit_int::GdbJitImageRegistration;
|
||||
pub use crate::mmap::Mmap;
|
||||
pub use crate::sig_registry::SignatureRegistry;
|
||||
pub use crate::trap_registry::{get_mut_trap_registry, get_trap_registry, TrapRegistrationGuard};
|
||||
pub use crate::traphandlers::{wasmtime_call, wasmtime_call_trampoline, Trap};
|
||||
pub use crate::traphandlers::resume_panic;
|
||||
pub use crate::traphandlers::{raise_user_trap, wasmtime_call, wasmtime_call_trampoline, Trap};
|
||||
pub use crate::vmcontext::{
|
||||
VMCallerCheckedAnyfunc, VMContext, VMFunctionBody, VMFunctionImport, VMGlobalDefinition,
|
||||
VMGlobalImport, VMInvokeArgument, VMMemoryDefinition, VMMemoryImport, VMSharedSignatureIndex,
|
||||
|
||||
Reference in New Issue
Block a user