diff options
| author | Henry <mail@henrygressmann.de> | 2026-04-16 23:29:00 +0200 |
|---|---|---|
| committer | Henry <mail@henrygressmann.de> | 2026-04-16 23:29:00 +0200 |
| commit | 5de0533875b6f439ea9e562cba93204ec15e3ba8 (patch) | |
| tree | edd4a4ea369d9ea0dfa599e9f01b960ca28c6802 /crates/parser/src/optimize.rs | |
| parent | e47089bf4c53323a22bd9d8ba4b7a8836fcb45a6 (diff) | |
chore: remove ref stack
Signed-off-by: Henry <mail@henrygressmann.de>
Diffstat (limited to 'crates/parser/src/optimize.rs')
| -rw-r--r-- | crates/parser/src/optimize.rs | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/crates/parser/src/optimize.rs b/crates/parser/src/optimize.rs index 1369d7a..c066c29 100644 --- a/crates/parser/src/optimize.rs +++ b/crates/parser/src/optimize.rs @@ -21,7 +21,6 @@ fn rewrite(instructions: &mut [Instruction], self_func_addr: u32) { Instruction::LocalCopy32(a, b) if a == b => instructions[read] = Instruction::Nop, Instruction::LocalCopy64(a, b) if a == b => instructions[read] = Instruction::Nop, Instruction::LocalCopy128(a, b) if a == b => instructions[read] = Instruction::Nop, - Instruction::LocalCopyRef(a, b) if a == b => instructions[read] = Instruction::Nop, Instruction::Call(addr) if addr == self_func_addr => instructions[read] = Instruction::CallSelf, Instruction::ReturnCall(addr) if addr == self_func_addr => instructions[read] = Instruction::ReturnCallSelf, Instruction::I32Add => { @@ -154,16 +153,6 @@ fn rewrite(instructions: &mut [Instruction], self_func_addr: u32) { instructions[read] = Instruction::Nop; } } - Instruction::LocalGetRef(dst) => { - if read > 0 - && let Instruction::LocalSetRef(src) = instructions[read - 1] - && src == dst - { - instructions[read - 1] = Instruction::LocalTeeRef(src); - instructions[read] = Instruction::Nop; - } - } - Instruction::LocalSet32(dst) => { if read > 0 { match instructions[read - 1] { @@ -243,16 +232,6 @@ fn rewrite(instructions: &mut [Instruction], self_func_addr: u32) { if src == dst { Instruction::Nop } else { Instruction::LocalCopy128(src, dst) }; } } - Instruction::LocalSetRef(dst) => { - if read > 0 - && let Instruction::LocalGetRef(src) = instructions[read - 1] - { - instructions[read - 1] = Instruction::Nop; - instructions[read] = - if src == dst { Instruction::Nop } else { Instruction::LocalCopyRef(src, dst) }; - } - } - Instruction::LocalTee32(dst) => { if read > 0 && let Instruction::LocalGet32(src) = instructions[read - 1] @@ -289,15 +268,6 @@ fn rewrite(instructions: &mut [Instruction], self_func_addr: u32) { instructions[read] = Instruction::Nop; } } - Instruction::LocalTeeRef(dst) => { - if read > 0 - && let Instruction::LocalGetRef(src) = instructions[read - 1] - && src == dst - { - instructions[read] = Instruction::Nop; - } - } - Instruction::Drop32 => { if read > 0 && let Instruction::LocalTee32(local) = instructions[read - 1] @@ -322,14 +292,6 @@ fn rewrite(instructions: &mut [Instruction], self_func_addr: u32) { instructions[read] = Instruction::Nop; } } - Instruction::DropRef => { - if read > 0 - && let Instruction::LocalTeeRef(local) = instructions[read - 1] - { - instructions[read - 1] = Instruction::LocalSetRef(local); - instructions[read] = Instruction::Nop; - } - } _ => {} } } |
