MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / append_stack_map_entries

Function append_stack_map_entries

cranelift/codegen/src/inline.rs:584–618  ·  view source on GitHub ↗

Append stack map entries from the caller and callee to the given inlined instruction.

(
    func: &mut ir::Function,
    callee: &ir::Function,
    entity_map: &EntityMap,
    call_stack_map: Option<&[ir::UserStackMapEntry]>,
    inlined_inst: ir::Inst,
    callee_inst: ir::Inst,
)

Source from the content-addressed store, hash-verified

582/// Append stack map entries from the caller and callee to the given inlined
583/// instruction.
584fn append_stack_map_entries(
585 func: &mut ir::Function,
586 callee: &ir::Function,
587 entity_map: &EntityMap,
588 call_stack_map: Option<&[ir::UserStackMapEntry]>,
589 inlined_inst: ir::Inst,
590 callee_inst: ir::Inst,
591) {
592 // Add the caller's stack map to this call. These entries
593 // already refer to caller entities and do not need further
594 // translation.
595 func.dfg.append_user_stack_map_entries(
596 inlined_inst,
597 call_stack_map
598 .iter()
599 .flat_map(|entries| entries.iter().cloned()),
600 );
601
602 // Append the callee's stack map to this call. These entries
603 // refer to callee entities and therefore do require
604 // translation into the caller's index space.
605 func.dfg.append_user_stack_map_entries(
606 inlined_inst,
607 callee
608 .dfg
609 .user_stack_map_entries(callee_inst)
610 .iter()
611 .flat_map(|entries| entries.iter())
612 .map(|entry| ir::UserStackMapEntry {
613 ty: entry.ty,
614 slot: entity_map.inlined_stack_slot(entry.slot),
615 offset: entry.offset,
616 }),
617 );
618}
619
620/// Create or update the exception tables for any inlined call instructions:
621/// when inlining at a `try_call` site, we must forward our exceptional edges

Callers 2

inline_oneFunction · 0.85
fixup_inst_that_returnsFunction · 0.85

Calls 5

inlined_stack_slotMethod · 0.80
iterMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected