From ca66978a5aadddf7895b49b44076c574e7e6a0b0 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sun, 27 Nov 2022 05:54:28 -0800 Subject: feat(ops): fast calls for Wasm (#16776) This PR introduces Wasm ops. These calls are optimized for entry from Wasm land. The `#[op(wasm)]` attribute is opt-in. Last parameter `Option<&mut [u8]>` is the memory slice of the Wasm module *when entered from a Fast API call*. Otherwise, the user is expected to implement logic to obtain the memory if `None` ```rust #[op(wasm)] pub fn op_args_get( offset: i32, buffer_offset: i32, memory: Option<&mut [u8]>, ) { // ... } ``` --- ops/optimizer_tests/wasm_op.rs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ops/optimizer_tests/wasm_op.rs (limited to 'ops/optimizer_tests/wasm_op.rs') diff --git a/ops/optimizer_tests/wasm_op.rs b/ops/optimizer_tests/wasm_op.rs new file mode 100644 index 000000000..b18f32fd1 --- /dev/null +++ b/ops/optimizer_tests/wasm_op.rs @@ -0,0 +1,3 @@ +fn op_wasm(memory: Option<&mut [u8]>) { + // @test-attr:wasm +} -- cgit v1.2.3