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

Method instruction_target

crates/jit/src/instructions.rs:183–205  ·  view source on GitHub ↗
(
        offset: u32,
        instruction: Instruction,
        arg: OpArg,
    )

Source from the content-addressed store, hash-verified

181 }
182
183 fn instruction_target(
184 offset: u32,
185 instruction: Instruction,
186 arg: OpArg,
187 ) -> Result<Option<Label>, JitCompileError> {
188 let caches = instruction.cache_entries() as u32;
189 let target = match instruction {
190 Instruction::JumpForward { .. } => {
191 Some(Self::jump_target_forward(offset, caches, arg)?)
192 }
193 Instruction::JumpBackward { .. } | Instruction::JumpBackwardNoInterrupt { .. } => {
194 Some(Self::jump_target_backward(offset, caches, arg)?)
195 }
196 Instruction::PopJumpIfFalse { .. }
197 | Instruction::PopJumpIfTrue { .. }
198 | Instruction::PopJumpIfNone { .. }
199 | Instruction::PopJumpIfNotNone { .. }
200 | Instruction::ForIter { .. }
201 | Instruction::Send { .. } => Some(Self::jump_target_forward(offset, caches, arg)?),
202 _ => None,
203 };
204 Ok(target)
205 }
206
207 pub fn compile<C: bytecode::Constant>(
208 &mut self,

Callers

nothing calls this directly

Calls 2

cache_entriesMethod · 0.80
SomeClass · 0.50

Tested by

no test coverage detected