From 28b8a556b51aecf9eaed92c1fc3e648e4efe7572 Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 28 Dec 2023 16:47:35 +0100 Subject: chore: add ref instructions Signed-off-by: Henry --- crates/types/src/instructions.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'crates/types') diff --git a/crates/types/src/instructions.rs b/crates/types/src/instructions.rs index 95fddc5..535b727 100644 --- a/crates/types/src/instructions.rs +++ b/crates/types/src/instructions.rs @@ -1,3 +1,5 @@ +use crate::MemAddr; + use super::{FuncAddr, GlobalAddr, LabelAddr, LocalAddr, TableAddr, TypeAddr, ValType}; #[derive(Debug, Copy, Clone, PartialEq, Eq)] @@ -26,6 +28,8 @@ pub enum ConstInstruction { F32Const(f32), F64Const(f64), GlobalGet(GlobalAddr), + RefNull(ValType), + RefFunc(FuncAddr), } /// A WebAssembly Instruction @@ -99,8 +103,8 @@ pub enum Instruction { I64Store8(MemArg), I64Store16(MemArg), I64Store32(MemArg), - MemorySize, - MemoryGrow, + MemorySize(MemAddr, u8), + MemoryGrow(MemAddr, u8), // Constants I32Const(i32), @@ -108,6 +112,11 @@ pub enum Instruction { F32Const(f32), F64Const(f64), + // Reference Types + RefNull(ValType), + RefFunc(FuncAddr), + RefIsNull, + // Numeric Instructions // See I32Eqz, -- cgit v1.3.1