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

Method execute_build_slice

crates/vm/src/frame.rs:6406–6426  ·  view source on GitHub ↗
(
        &mut self,
        vm: &VirtualMachine,
        argc: bytecode::BuildSliceArgCount,
    )

Source from the content-addressed store, hash-verified

6404 }
6405
6406 fn execute_build_slice(
6407 &mut self,
6408 vm: &VirtualMachine,
6409 argc: bytecode::BuildSliceArgCount,
6410 ) -> FrameResult {
6411 let step = match argc {
6412 bytecode::BuildSliceArgCount::Two => None,
6413 bytecode::BuildSliceArgCount::Three => Some(self.pop_value()),
6414 };
6415 let stop = self.pop_value();
6416 let start = self.pop_value();
6417
6418 let obj = PySlice {
6419 start: Some(start),
6420 stop,
6421 step,
6422 }
6423 .into_ref(&vm.ctx);
6424 self.push_value(obj.into());
6425 Ok(None)
6426 }
6427
6428 fn collect_positional_args(&mut self, nargs: u32) -> FuncArgs {
6429 FuncArgs {

Callers 1

execute_instructionMethod · 0.80

Calls 4

pop_valueMethod · 0.80
push_valueMethod · 0.80
SomeClass · 0.50
into_refMethod · 0.45

Tested by

no test coverage detected