* Update cranelift to 0.58.0 * Update `wasmprinter` dep to require 0.2.1 We already had it in the lock file, but this ensures we won't ever go back down. * Ensure that our error messages match `assert_invalid`'s The bulk of this work was done in https://github.com/bytecodealliance/wasmparser/pull/186 but now we can test it at the `wasmtime` level as well. Fixes #492 * Stop feeling guilty about not matching `assert_malformed` messages Remove the "TODO" and stop printing warning messages. These would just be busy work to implement, and getting all the messages the exact same relies on using the same structure as the spec interpreter's parser, which means that where you have a helper function and they don't, then things go wrong, and vice versa. Not worth it. Fixes #492 * Enable (but ignore) the reference-types proposal tests * Match test suite directly, instead of roundabout starts/endswith * Enable (but ignore) bulk memory operations proposal test suite
58 lines
1.9 KiB
Rust
58 lines
1.9 KiB
Rust
#![allow(missing_docs)]
|
|
|
|
pub mod ir {
|
|
pub use cranelift_codegen::ir::{
|
|
ExternalName, Function, InstBuilder, MemFlags, StackSlotData, StackSlotKind,
|
|
};
|
|
}
|
|
pub use cranelift_codegen::print_errors::pretty_error;
|
|
pub use cranelift_codegen::Context;
|
|
pub use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext};
|
|
|
|
pub mod binemit {
|
|
pub use cranelift_codegen::binemit::NullTrapSink;
|
|
pub use cranelift_codegen::binemit::{CodeOffset, NullStackmapSink, TrapSink};
|
|
|
|
use cranelift_codegen::{binemit, ir};
|
|
|
|
/// We don't expect trampoline compilation to produce any relocations, so
|
|
/// this `RelocSink` just asserts that it doesn't recieve any.
|
|
pub struct TrampolineRelocSink {}
|
|
|
|
impl binemit::RelocSink for TrampolineRelocSink {
|
|
fn reloc_block(
|
|
&mut self,
|
|
_offset: binemit::CodeOffset,
|
|
_reloc: binemit::Reloc,
|
|
_block_offset: binemit::CodeOffset,
|
|
) {
|
|
panic!("trampoline compilation should not produce block relocs");
|
|
}
|
|
fn reloc_external(
|
|
&mut self,
|
|
_offset: binemit::CodeOffset,
|
|
_reloc: binemit::Reloc,
|
|
_name: &ir::ExternalName,
|
|
_addend: binemit::Addend,
|
|
) {
|
|
panic!("trampoline compilation should not produce external symbol relocs");
|
|
}
|
|
fn reloc_constant(
|
|
&mut self,
|
|
_code_offset: binemit::CodeOffset,
|
|
_reloc: binemit::Reloc,
|
|
_constant_offset: ir::ConstantOffset,
|
|
) {
|
|
panic!("trampoline compilation should not produce constant relocs");
|
|
}
|
|
fn reloc_jt(
|
|
&mut self,
|
|
_offset: binemit::CodeOffset,
|
|
_reloc: binemit::Reloc,
|
|
_jt: ir::JumpTable,
|
|
) {
|
|
panic!("trampoline compilation should not produce jump table relocs");
|
|
}
|
|
}
|
|
}
|