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

Function iinc_pattern

src/lower2/optimise2.rs:1403–1434  ·  view source on GitHub ↗
(instructions: &[Instruction], index: usize)

Source from the content-addressed store, hash-verified

1401 local_reads(instruction)
1402 .into_iter()
1403 .chain(local_writes(instruction))
1404 })
1405 .map(|local| local.index + local.width)
1406 .max()
1407 .unwrap_or(0)
1408}
1409
1410fn protected_instruction_indices(
1411 instructions: &[Instruction],
1412 exception_table: &[ExceptionTableEntry],
1413) -> BTreeSet<usize> {
1414 let mut protected = BTreeSet::from([0usize]);
1415 for (index, instruction) in instructions.iter().enumerate() {
1416 visit_branch_targets(index, instruction, |target| {
1417 if target >= 0 {
1418 protected.insert(target as usize);
1419 }
1420 });
1421 }
1422 for entry in exception_table {
1423 protected.insert(usize::from(entry.range_pc.start));
1424 if usize::from(entry.range_pc.end) < instructions.len() {
1425 protected.insert(usize::from(entry.range_pc.end));
1426 }
1427 protected.insert(usize::from(entry.handler_pc));
1428 }
1429 protected
1430}
1431
1432fn compact_instructions(
1433 instructions: Vec<Instruction>,
1434 source_locations: Vec<BytecodeMetadata>,
1435 keep: &[bool],
1436 exception_table: &mut Vec<ExceptionTableEntry>,
1437) -> jvm::Result<LocatedInstructions> {

Callers 1

fold_iinc_patternsFunction · 0.85

Calls 3

local_storeFunction · 0.85
local_loadFunction · 0.85
int_constantFunction · 0.85

Tested by

no test coverage detected