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

Method upcall_scope

core/src/vm/mod.rs:310–332  ·  view source on GitHub ↗

Constructs a `Scope` for an upcall with arguments starting at `reg`. `upcall_pc` is the address of the UPCALL instruction in the image, used to look up per-argument source locations from `DebugInfo`. `is_function` indicates whether the upcall is a function (with a return value slot) so that `Scope::arg_offset` can be set appropriately.

(
        &'a mut self,
        image: &'a Image,
        reg: Register,
        is_function: bool,
        upcall_pc: usize,
    )

Source from the content-addressed store, hash-verified

308 /// upcall is a function (with a return value slot) so that `Scope::arg_offset` can be set
309 /// appropriately.
310 fn upcall_scope<'a>(
311 &'a mut self,
312 image: &'a Image,
313 reg: Register,
314 is_function: bool,
315 upcall_pc: usize,
316 ) -> Scope<'a> {
317 let arg_linecols = image
318 .debug_info
319 .instrs
320 .get(upcall_pc)
321 .map(|m| m.arg_linecols.as_slice())
322 .unwrap_or(&[]);
323 self.context.upcall_scope(
324 reg,
325 is_function,
326 image.constants.as_slice(),
327 &mut self.heap,
328 arg_linecols,
329 &self.last_error,
330 image.data.as_slice(),
331 )
332 }
333
334 /// Handles an exception raised at `pc`, corresponding to `pos`, with `message`. Returns true if the error was handled.
335 fn handle_exception(

Callers 1

prepare_upcallMethod · 0.45

Calls 2

getMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected