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

Method lift_accessor

crates/wizer/src/component/instrument.rs:293–326  ·  view source on GitHub ↗
(
        &mut self,
        item: &str,
        lift_type_index: u32,
        opts: &[wasm_encoder::CanonicalOption],
    )

Source from the content-addressed store, hash-verified

291 }
292
293 fn lift_accessor(
294 &mut self,
295 item: &str,
296 lift_type_index: u32,
297 opts: &[wasm_encoder::CanonicalOption],
298 ) -> String {
299 let accessor_core_export_name = self.accessors.len().to_string();
300 self.accessor_exports.export(
301 &accessor_core_export_name,
302 wasm_encoder::ExportKind::Func,
303 self.accessor_functions.len() - 1,
304 );
305
306 self.extra_aliases
307 .alias(wasm_encoder::Alias::CoreInstanceExport {
308 instance: self.accessor_instance_index(),
309 kind: wasm_encoder::ExportKind::Func,
310 name: &accessor_core_export_name,
311 });
312 self.extra_core_funcs += 1;
313 self.extra_canonicals.lift(
314 self.component.core_funcs + self.extra_core_funcs - 1,
315 lift_type_index,
316 opts.iter().copied(),
317 );
318
319 let accessor_export_name = format!("{item}{}", self.accessors.len());
320 self.accessor_instance_export_items.push((
321 accessor_export_name.clone(),
322 wasm_encoder::ComponentExportKind::Func,
323 self.component.funcs + self.extra_canonicals.len() - 1,
324 ));
325 accessor_export_name
326 }
327
328 fn finish(&mut self, encoder: &mut wasm_encoder::Component) {
329 // Build the `accessor_module` and add it to the component.

Callers 2

Calls 10

aliasMethod · 0.80
liftMethod · 0.80
copiedMethod · 0.80
to_stringMethod · 0.45
lenMethod · 0.45
exportMethod · 0.45
iterMethod · 0.45
pushMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected