MCPcopy Index your code
hub / github.com/explodingcamera/tinywasm / label_keep_counts_for_frame

Method label_keep_counts_for_frame

crates/parser/src/visit.rs:650–669  ·  view source on GitHub ↗
(&self, frame: &wasmparser::Frame)

Source from the content-addressed store, hash-verified

648 }
649
650 fn label_keep_counts_for_frame(&self, frame: &wasmparser::Frame) -> (u16, u16, u16) {
651 match &frame.block_type {
652 wasmparser::BlockType::Empty => (0, 0, 0),
653 wasmparser::BlockType::Type(ty) => match frame.kind {
654 FrameKind::Loop => (0, 0, 0),
655 _ => Self::label_keep_counts(core::slice::from_ref(ty)),
656 },
657 wasmparser::BlockType::FuncType(idx) => {
658 let sub_type = self.validator.resources().sub_type_at(*idx);
659 let func_ty = match sub_type {
660 Some(st) => st.composite_type.unwrap_func(),
661 None => return (0, 0, 0),
662 };
663 match frame.kind {
664 FrameKind::Loop => Self::label_keep_counts(func_ty.params()),
665 _ => Self::label_keep_counts(func_ty.results()),
666 }
667 }
668 }
669 }
670
671 fn emit_dropkeep_to_label(&mut self, label_depth: u32) {
672 if self.is_unreachable() {

Callers 2

emit_br_table_padMethod · 0.80

Calls 2

paramsMethod · 0.80
resultsMethod · 0.80

Tested by

no test coverage detected