wasmtime: Implement table.get and table.set
These instructions have fast, inline JIT paths for the common cases, and only
call out to host VM functions for the slow paths. This required some changes to
`cranelift-wasm`'s `FuncEnvironment`: instead of taking a `FuncCursor` to insert
an instruction sequence within the current basic block,
`FuncEnvironment::translate_table_{get,set}` now take a `&mut FunctionBuilder`
so that they can create whole new basic blocks. This is necessary for
implementing GC read/write barriers that involve branching (e.g. checking for
null, or whether a store buffer is at capacity).
Furthermore, it required that the `load`, `load_complex`, and `store`
instructions handle loading and storing through an `r{32,64}` rather than just
`i{32,64}` addresses. This involved making `r{32,64}` types acceptable
instantiations of the `iAddr` type variable, plus a few new instruction
encodings.
Part of #929
This commit is contained in:
22
build.rs
22
build.rs
@@ -205,18 +205,20 @@ fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
|
||||
("simd", "simd_i16x8_arith2") => return true,
|
||||
("simd", "simd_i8x16_arith2") => return true,
|
||||
|
||||
("reference_types", "table_copy_on_imported_tables")
|
||||
| ("reference_types", "externref_id_function")
|
||||
| ("reference_types", "table_size")
|
||||
| ("reference_types", "simple_ref_is_null")
|
||||
| ("reference_types", "table_grow_with_funcref") => {
|
||||
// TODO(#1886): Ignore if this isn't x64, because Cranelift only
|
||||
// supports reference types on x64.
|
||||
return env::var("CARGO_CFG_TARGET_ARCH").unwrap() != "x86_64";
|
||||
// Still working on implementing these. See #929.
|
||||
("reference_types", "global")
|
||||
| ("reference_types", "linking")
|
||||
| ("reference_types", "ref_func")
|
||||
| ("reference_types", "ref_null")
|
||||
| ("reference_types", "table_fill") => {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Still working on implementing these. See #929.
|
||||
("reference_types", _) => return true,
|
||||
// TODO(#1886): Ignore reference types tests if this isn't x64,
|
||||
// because Cranelift only supports reference types on x64.
|
||||
("reference_types", _) => {
|
||||
return env::var("CARGO_CFG_TARGET_ARCH").unwrap() != "x86_64";
|
||||
}
|
||||
|
||||
_ => {}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user