MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / jump_target

Function jump_target

crates/parser/src/optimize.rs:809–828  ·  view source on GitHub ↗
(instr: Instruction)

Source from the content-addressed store, hash-verified

807}
808
809fn jump_target(instr: Instruction) -> Option<u32> {
810 Some(match instr {
811 Instruction::Jump(ip)
812 | Instruction::JumpIfZero32(ip)
813 | Instruction::JumpIfNonZero32(ip)
814 | Instruction::JumpIfZero64(ip)
815 | Instruction::JumpIfNonZero64(ip) => ip,
816 Instruction::JumpCmpStackConst32 { target_ip, .. }
817 | Instruction::JumpCmpStackConst64 { target_ip, .. }
818 | Instruction::JumpIfLocalZero32 { target_ip, .. }
819 | Instruction::JumpIfLocalNonZero32 { target_ip, .. }
820 | Instruction::JumpIfLocalZero64 { target_ip, .. }
821 | Instruction::JumpIfLocalNonZero64 { target_ip, .. }
822 | Instruction::JumpCmpLocalConst32 { target_ip, .. }
823 | Instruction::JumpCmpLocalConst64 { target_ip, .. }
824 | Instruction::JumpCmpLocalLocal32 { target_ip, .. }
825 | Instruction::JumpCmpLocalLocal64 { target_ip, .. } => target_ip,
826 _ => return None,
827 })
828}
829
830fn set_jump_target(instr: &mut Instruction, target: u32) {
831 match instr {

Callers 1

canonicalize_jump_likeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected