diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-25 14:06:04 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-25 14:06:04 +0200 |
| commit | 4d829a824834b470ada9981ab3ab2caa3e289378 (patch) | |
| tree | 962029814c19f14b5675acb5fee191abd2a43297 /crates/types | |
| parent | 19038bfea6a65e2aad89ec6a8fa51c41da35b219 (diff) | |
chore: reduce instantiation ovherhead & refactor optimize
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/types')
| -rw-r--r-- | crates/types/src/instructions.rs | 14 | ||||
| -rw-r--r-- | crates/types/src/lib.rs | 1 |
2 files changed, 9 insertions, 6 deletions
diff --git a/crates/types/src/instructions.rs b/crates/types/src/instructions.rs index 48158de..a1bc0fe 100644 --- a/crates/types/src/instructions.rs +++ b/crates/types/src/instructions.rs @@ -132,7 +132,7 @@ pub enum Instruction { BinOpLocalConstTee32(BinOp, LocalAddr, i32, LocalAddr), BinOpLocalConstTee64(BinOp, LocalAddr, i64, LocalAddr), BinOpLocalConstTee128(BinOp128, LocalAddr, ConstIdx, LocalAddr), - SetLocalConst32(LocalAddr, i32), SetLocalConst64(LocalAddr, i64), + SetLocalConst32(LocalAddr, i32), SetLocalConst64(LocalAddr, i64), SetLocalConst128(LocalAddr, ConstIdx), StoreLocalLocal32(MemoryArg, u8, u8), StoreLocalLocal64(MemoryArg, u8, u8), StoreLocalLocal128(MemoryArg, u8, u8), @@ -158,6 +158,10 @@ pub enum Instruction { JumpIfNonZero32(u32), JumpIfZero64(u32), JumpIfNonZero64(u32), + JumpIfLocalZero32 { target_ip: u32, local: LocalAddr }, + JumpIfLocalNonZero32 { target_ip: u32, local: LocalAddr }, + JumpIfLocalZero64 { target_ip: u32, local: LocalAddr }, + JumpIfLocalNonZero64 { target_ip: u32, local: LocalAddr }, JumpCmpStackConst32 { target_ip: u32, imm: i32, op: CmpOp }, JumpCmpStackConst64 { target_ip: u32, imm: i64, op: CmpOp }, JumpCmpLocalConst32 { target_ip: u32, local: LocalAddr, imm: i32, op: CmpOp }, @@ -219,10 +223,8 @@ pub enum Instruction { MemoryGrow(MemAddr), // > Constants - I32Const(i32), - I64Const(i64), - F32Const(f32), - F64Const(f64), + Const32(i32), + Const64(i64), // > Reference Types RefNull(WasmType), @@ -290,7 +292,7 @@ pub enum Instruction { V128Store(MemoryArg), V128Store8Lane(MemoryArg, u8), V128Store16Lane(MemoryArg, u8), V128Store32Lane(MemoryArg, u8), V128Store64Lane(MemoryArg, u8), I8x16Shuffle(ConstIdx), - V128Const(ConstIdx), + Const128(ConstIdx), I8x16ExtractLaneS(u8), I8x16ExtractLaneU(u8), I8x16ReplaceLane(u8), I16x8ExtractLaneS(u8), I16x8ExtractLaneU(u8), I16x8ReplaceLane(u8), diff --git a/crates/types/src/lib.rs b/crates/types/src/lib.rs index 3eb14ba..29eb709 100644 --- a/crates/types/src/lib.rs +++ b/crates/types/src/lib.rs @@ -418,6 +418,7 @@ pub struct WasmFunction { pub data: WasmFunctionData, pub locals: ValueCounts, pub params: ValueCounts, + pub results: ValueCounts, pub ty: Arc<FuncType>, } |
