Skip to content

Conversation

@alexcrichton
Copy link
Member

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

@alexcrichton
Copy link
Member Author

Ok updated!

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 bytecodealliance#839 and otherwise will...

Closes bytecodealliance#848
Copy link
Member

@peterhuene peterhuene left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍. Just a nit and a comment.

@alexcrichton alexcrichton merged commit 83ff015 into bytecodealliance:master Jan 30, 2020
@alexcrichton alexcrichton deleted the remove-thread-local branch January 30, 2020 14:15
arkpar pushed a commit to paritytech/wasmtime that referenced this pull request Mar 4, 2020
…tecodealliance#857)

To use, enable the "basic-blocks" feature on cranelift-frontend.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panics are not caught within Callable

3 participants