MCPcopy Index your code
hub / github.com/endbasic/endbasic / prepare_upcall

Method prepare_upcall

core/src/vm/mod.rs:150–161  ·  view source on GitHub ↗

Resolves upcall metadata and builds an execution scope for invocation.

(
        &'a mut self,
        image: &'a Image,
        index: u16,
        first_reg: Register,
        upcall_pc: usize,
    )

Source from the content-addressed store, hash-verified

148impl Vm {
149 /// Resolves upcall metadata and builds an execution scope for invocation.
150 fn prepare_upcall<'a>(
151 &'a mut self,
152 image: &'a Image,
153 index: u16,
154 first_reg: Register,
155 upcall_pc: usize,
156 ) -> (Rc<dyn Callable>, Scope<'a>) {
157 let upcall = self.upcalls[usize::from(index)].clone();
158 let is_function = upcall.metadata().return_type().is_some();
159 let scope = self.upcall_scope(image, first_reg, is_function, upcall_pc);
160 (upcall, scope)
161 }
162
163 /// Handles the result of an upcall invocation.
164 ///

Callers 2

invokeMethod · 0.80
execMethod · 0.80

Calls 3

return_typeMethod · 0.80
metadataMethod · 0.45
upcall_scopeMethod · 0.45

Tested by

no test coverage detected