977: fix(runtime-core) Remove unnecessary implementation of `WasmTypeList` r=Hywan a=Hywan
The unit tests `test_func_arity_*` covers all possibilities, from 0 to
12. Removing this specific implementation of `WasmTypeList` for `(A,)`
doesn't break the test cases.
Also, the `impl_traits!` macro already implement `WasmTypeList` for
`(A,)` with `impl_traits!([transparent] S1, A)`. It's not clear why
`rustc` doesn't detect that though.
Co-authored-by: Ivan Enderlin <ivan.enderlin@hoa-project.net>
The unit tests `test_func_arity_*` covers all possibilities, from 0 to
12. Removing this specific implementation of `WasmTypeList` for `(A,)`
doesn't break the test cases.
Also, the `impl_traits!` macro already implement `WasmTypeList` for
`(A,)` with `impl_traits!([transparent] S1, A)`. It's not clear why
`rustc` doesn't detect that though.
By exposing the target information through `CompilerConfig`,
compiler(only LLVM at the moment) could create a machine with
different CPU feature flags other than current host, which makes it
capable to "cross compile" to some degree.
Update #959
The `field-offset` crate is unmaintained. When using its `offset_of!`
macro on a struct with a field of type `std::ptr::NonNull`, in release
mode, it generates a sigill.
This patch removes the `field-offset` crate, and implements a custom
`offset_of!` macro.
Host functions use `Context::External` with a `*mut vm::FuncCtx`
pointer, casted to `*mut vm::Ctx`. It creates a conflict with exports
that also use `Context::External`.
This patch introduces `Context::ExternalWithEnv` to create a specific
path in the code for an external context with `*mut vm::FuncEnv`.
This patch fixes all the `linking.wast` tests in the spectests.
In the `wrap` functions, we use `std::mem::transmute(&())` to get the
pointer to the value “around” `wrap` (`Fn` has a method `to_raw` which
declares a `wrap` function, which uses `transmute` to retrieve
`Fn`). This is an undefined behavior. It was working until the
`FuncCtx` is introduced. Since then, the undefined behavior was
causing an error with the Singlepass backend.
This patch stores the pointer to `Fn` in `func_env`, so that the
pointer to the user-defined host function is always predictable.