cranelift-wasm: Pass ir::Tables into all the translate_table_* methods

This serves two purposes:

1. It ensures that we call `get_or_create_table` to ensure that the embedder
already had a chance to create the given table (although this is mostly
redundant due to validation).

2. It allows the embedder to easily get the `ir::TableData` associated with this
table, and more easily emit whatever inline JIT code to translate the table
instruction (rather than falling back to VM calls).
This commit is contained in:
Nick Fitzgerald
2020-06-22 16:56:03 -07:00
parent 8082aeaa5f
commit 28fccaedc4
5 changed files with 33 additions and 15 deletions

View File

@@ -622,6 +622,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
&mut self,
mut pos: cranelift_codegen::cursor::FuncCursor<'_>,
table_index: TableIndex,
_table: ir::Table,
delta: ir::Value,
init_value: ir::Value,
) -> WasmResult<ir::Value> {
@@ -649,6 +650,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
&mut self,
_: cranelift_codegen::cursor::FuncCursor<'_>,
_: TableIndex,
_: ir::Table,
_: ir::Value,
) -> WasmResult<ir::Value> {
Err(WasmError::Unsupported(
@@ -660,6 +662,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
&mut self,
_: cranelift_codegen::cursor::FuncCursor<'_>,
_: TableIndex,
_: ir::Table,
_: ir::Value,
_: ir::Value,
) -> WasmResult<()> {