MCPcopy Index your code
hub / github.com/RustPython/RustPython / call_intrinsic_2

Method call_intrinsic_2

crates/vm/src/frame.rs:9490–9528  ·  view source on GitHub ↗
(
        &mut self,
        func: bytecode::IntrinsicFunction2,
        arg1: PyObjectRef,
        arg2: PyObjectRef,
        vm: &VirtualMachine,
    )

Source from the content-addressed store, hash-verified

9488 }
9489
9490 fn call_intrinsic_2(
9491 &mut self,
9492 func: bytecode::IntrinsicFunction2,
9493 arg1: PyObjectRef,
9494 arg2: PyObjectRef,
9495 vm: &VirtualMachine,
9496 ) -> PyResult {
9497 match func {
9498 bytecode::IntrinsicFunction2::SetTypeparamDefault => {
9499 crate::stdlib::_typing::set_typeparam_default(arg1, arg2, vm)
9500 }
9501 bytecode::IntrinsicFunction2::SetFunctionTypeParams => {
9502 // arg1 is the function, arg2 is the type params tuple
9503 // Set __type_params__ attribute on the function
9504 arg1.set_attr("__type_params__", arg2, vm)?;
9505 Ok(arg1)
9506 }
9507 bytecode::IntrinsicFunction2::TypeVarWithBound => {
9508 let type_var: PyObjectRef =
9509 _typing::TypeVar::new(vm, arg1.clone(), arg2, vm.ctx.none())
9510 .into_ref(&vm.ctx)
9511 .into();
9512 Ok(type_var)
9513 }
9514 bytecode::IntrinsicFunction2::TypeVarWithConstraint => {
9515 let type_var: PyObjectRef =
9516 _typing::TypeVar::new(vm, arg1.clone(), vm.ctx.none(), arg2)
9517 .into_ref(&vm.ctx)
9518 .into();
9519 Ok(type_var)
9520 }
9521 bytecode::IntrinsicFunction2::PrepReraiseStar => {
9522 // arg1 = orig (original exception)
9523 // arg2 = excs (list of exceptions raised/reraised in except* blocks)
9524 // Returns: exception to reraise, or None if nothing to reraise
9525 crate::exceptions::prep_reraise_star(arg1, arg2, vm)
9526 }
9527 }
9528 }
9529
9530 /// Pop multiple values from the stack. Panics if any slot is NULL.
9531 fn pop_multiple(&mut self, count: usize) -> impl ExactSizeIterator<Item = PyObjectRef> + '_ {

Callers 1

execute_instructionMethod · 0.80

Calls 7

set_typeparam_defaultFunction · 0.85
newFunction · 0.85
prep_reraise_starFunction · 0.85
noneMethod · 0.80
set_attrMethod · 0.45
into_refMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected