MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / write_fields_to_memory

Method write_fields_to_memory

crates/core/src/abi.rs:2135–2156  ·  view source on GitHub ↗
(
        &mut self,
        tys: impl IntoIterator<Item = &'b Type, IntoIter: ExactSizeIterator>,
        addr: B::Operand,
        offset: ArchitectureSize,
    )

Source from the content-addressed store, hash-verified

2133 }
2134
2135 fn write_fields_to_memory<'b>(
2136 &mut self,
2137 tys: impl IntoIterator<Item = &'b Type, IntoIter: ExactSizeIterator>,
2138 addr: B::Operand,
2139 offset: ArchitectureSize,
2140 ) {
2141 let tys = tys.into_iter();
2142 let fields = self
2143 .stack
2144 .drain(self.stack.len() - tys.len()..)
2145 .collect::<Vec<_>>();
2146 for ((field_offset, ty), op) in self
2147 .bindgen
2148 .sizes()
2149 .field_offsets(tys)
2150 .into_iter()
2151 .zip(fields)
2152 {
2153 self.stack.push(op);
2154 self.write_to_memory(ty, addr.clone(), offset + (field_offset));
2155 }
2156 }
2157
2158 fn lower_and_emit(&mut self, ty: &Type, addr: B::Operand, instr: &Instruction) {
2159 self.lower(ty);

Callers 2

write_to_memoryMethod · 0.80

Calls 3

write_to_memoryMethod · 0.80
sizesMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected