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:
@@ -537,6 +537,7 @@ impl VMBuiltinFunctionsArray {
|
||||
pub fn initialized() -> Self {
|
||||
use crate::libcalls::*;
|
||||
let mut ptrs = [0; Self::len()];
|
||||
|
||||
ptrs[BuiltinFunctionIndex::get_memory32_grow_index().index() as usize] =
|
||||
wasmtime_memory32_grow as usize;
|
||||
ptrs[BuiltinFunctionIndex::get_imported_memory32_grow_index().index() as usize] =
|
||||
@@ -545,6 +546,21 @@ impl VMBuiltinFunctionsArray {
|
||||
wasmtime_memory32_size as usize;
|
||||
ptrs[BuiltinFunctionIndex::get_imported_memory32_size_index().index() as usize] =
|
||||
wasmtime_imported_memory32_size as usize;
|
||||
|
||||
ptrs[BuiltinFunctionIndex::get_table_copy_defined_defined_index().index() as usize] =
|
||||
wasmtime_table_copy_defined_defined as usize;
|
||||
|
||||
ptrs[BuiltinFunctionIndex::get_table_copy_defined_imported_index().index() as usize] =
|
||||
wasmtime_table_copy_defined_imported as usize;
|
||||
|
||||
ptrs[BuiltinFunctionIndex::get_table_copy_imported_defined_index().index() as usize] =
|
||||
wasmtime_table_copy_imported_defined as usize;
|
||||
|
||||
ptrs[BuiltinFunctionIndex::get_table_copy_imported_imported_index().index() as usize] =
|
||||
wasmtime_table_copy_imported_imported as usize;
|
||||
|
||||
debug_assert!(ptrs.iter().cloned().all(|p| p != 0));
|
||||
|
||||
Self { ptrs }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user