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

@@ -355,6 +355,7 @@ pub trait FuncEnvironment: TargetEnvironment {
&mut self,
pos: FuncCursor,
table_index: TableIndex,
table: ir::Table,
delta: ir::Value,
init_value: ir::Value,
) -> WasmResult<ir::Value>;
@@ -364,6 +365,7 @@ pub trait FuncEnvironment: TargetEnvironment {
&mut self,
pos: FuncCursor,
table_index: TableIndex,
table: ir::Table,
index: ir::Value,
) -> WasmResult<ir::Value>;
@@ -372,6 +374,7 @@ pub trait FuncEnvironment: TargetEnvironment {
&mut self,
pos: FuncCursor,
table_index: TableIndex,
table: ir::Table,
value: ir::Value,
index: ir::Value,
) -> WasmResult<()>;