MCPcopy Create free account
hub / github.com/IntegralPilot/rustc_codegen_jvm / thread_switch_target

Function thread_switch_target

src/lower2/optimise2.rs:1479–1499  ·  view source on GitHub ↗
(
    instructions: &[Instruction],
    source_index: usize,
    target: i32,
)

Source from the content-addressed store, hash-verified

1477 .skip(old)
1478 .find_map(|mapped| *mapped)
1479 .unwrap_or(next_index);
1480 u16::try_from(mapped).map_err(|_| jvm::Error::VerificationError {
1481 context: "optimise2".to_string(),
1482 message: "Compacted exception range end exceeds the JVM limit".to_string(),
1483 })
1484 };
1485 for entry in exception_table.iter_mut() {
1486 entry.range_pc =
1487 map_exact_boundary(entry.range_pc.start)?..map_end_boundary(entry.range_pc.end)?;
1488 entry.handler_pc = map_exact_boundary(entry.handler_pc)?;
1489 }
1490
1491 let mut compacted = Vec::with_capacity(next_index);
1492 let mut compacted_locations = Vec::with_capacity(next_index);
1493 for (old_index, (instruction, source_location)) in
1494 instructions.into_iter().zip(source_locations).enumerate()
1495 {
1496 if !keep[old_index] {
1497 continue;
1498 }
1499 let new_index = old_to_new[old_index].ok_or_else(|| jvm::Error::VerificationError {
1500 context: "optimise2".to_string(),
1501 message: format!("Kept instruction {old_index} has no compacted index"),
1502 })?;

Callers 1

thread_jump_targetsFunction · 0.85

Calls 2

resolve_goto_chainFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected