MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / call_inner

Method call_inner

aiscript-vm/src/vm/state.rs:1707–1734  ·  view source on GitHub ↗
(
        &mut self,
        closure: Gc<'gc, Closure<'gc>>,
        args_count: u8,
        keyword_args_count: u8,
        args: Vec<Value<'gc>>,
    )

Source from the content-addressed store, hash-verified

1705
1706 #[inline]
1707 fn call_inner(
1708 &mut self,
1709 closure: Gc<'gc, Closure<'gc>>,
1710 args_count: u8,
1711 keyword_args_count: u8,
1712 args: Vec<Value<'gc>>,
1713 ) -> Result<(), VmError> {
1714 self.stack_top -= args_count as usize + keyword_args_count as usize * 2;
1715 let slot_start = self.stack_top - 1; // -1 for the function itself
1716
1717 for arg in args {
1718 self.push_stack(arg);
1719 }
1720
1721 // Create the call frame
1722 let call_frame = CallFrame {
1723 closure,
1724 ip: 0,
1725 slot_start,
1726 };
1727
1728 #[cfg(feature = "debug")]
1729 call_frame.disassemble();
1730 self.frames.push(call_frame);
1731 self.frame_count += 1;
1732
1733 Ok(())
1734 }
1735
1736 #[inline(always)]
1737 pub fn push_stack(&mut self, value: Value<'gc>) {

Callers 2

call_constructorMethod · 0.80
callMethod · 0.80

Calls 3

push_stackMethod · 0.80
pushMethod · 0.80
disassembleMethod · 0.45

Tested by

no test coverage detected