Add support for table.copy
This adds support for the `table.copy` instruction from the bulk memory proposal. It also supports multiple tables, which were introduced by the reference types proposal. Part of #928
This commit is contained in:
@@ -6,7 +6,7 @@ use cranelift_codegen::ir;
|
||||
use cranelift_entity::{EntityRef, PrimaryMap};
|
||||
use cranelift_wasm::{
|
||||
DefinedFuncIndex, DefinedGlobalIndex, DefinedMemoryIndex, DefinedTableIndex, FuncIndex, Global,
|
||||
GlobalIndex, Memory, MemoryIndex, SignatureIndex, Table, TableIndex,
|
||||
GlobalIndex, Memory, MemoryIndex, PassiveElemIndex, SignatureIndex, Table, TableIndex,
|
||||
};
|
||||
use indexmap::IndexMap;
|
||||
use more_asserts::assert_ge;
|
||||
@@ -165,6 +165,9 @@ pub struct Module {
|
||||
/// WebAssembly table initializers.
|
||||
pub table_elements: Vec<TableElements>,
|
||||
|
||||
/// WebAssembly passive elements.
|
||||
pub passive_elements: HashMap<PassiveElemIndex, Box<[FuncIndex]>>,
|
||||
|
||||
/// WebAssembly table initializers.
|
||||
pub func_names: HashMap<FuncIndex, String>,
|
||||
}
|
||||
@@ -219,6 +222,7 @@ impl Module {
|
||||
exports: IndexMap::new(),
|
||||
start_func: None,
|
||||
table_elements: Vec::new(),
|
||||
passive_elements: HashMap::new(),
|
||||
func_names: HashMap::new(),
|
||||
local: ModuleLocal {
|
||||
num_imported_funcs: 0,
|
||||
|
||||
Reference in New Issue
Block a user