Wasm: Allow environment to translate some global.set/get operations
Spidermonkey will need to emit pre/post barriers for global.set/get to a reference type. #1176 and #1299 plan to add a template concept that could be used to implement this. Once that has been stabilized, we should be able to remove this code in favor of templates easily.
This commit is contained in:
@@ -504,6 +504,23 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
) -> WasmResult<ir::Value> {
|
||||
Ok(pos.ins().null(self.reference_type()))
|
||||
}
|
||||
|
||||
fn translate_custom_global_get(
|
||||
&mut self,
|
||||
mut pos: FuncCursor,
|
||||
_global_index: GlobalIndex,
|
||||
) -> WasmResult<ir::Value> {
|
||||
Ok(pos.ins().iconst(I32, -1))
|
||||
}
|
||||
|
||||
fn translate_custom_global_set(
|
||||
&mut self,
|
||||
_pos: FuncCursor,
|
||||
_global_index: GlobalIndex,
|
||||
_val: ir::Value,
|
||||
) -> WasmResult<()> {
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl TargetEnvironment for DummyEnvironment {
|
||||
|
||||
Reference in New Issue
Block a user