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

Function transfer_instruction

src/lower2/stackmaps.rs:439–958  ·  view source on GitHub ↗
(
    instruction_index: usize,
    instruction: &Instruction,
    mut state: FrameState,
    local_hints: &[FrameValue],
    constant_pool: &ConstantPool,
    context: &str,
)

Source from the content-addressed store, hash-verified

437 let remaining = locals_loaded_before_definite_store(
438 instructions,
439 initial_locals,
440 max_locals as usize,
441 context,
442 exception_table,
443 )?;
444 if !remaining.is_empty() {
445 return Err(jvm::Error::VerificationError {
446 context: context.to_string(),
447 message: format!(
448 "Local initialization could not resolve verifier Top loads: {remaining:?}"
449 ),
450 });
451 }
452
453 let analysis = solve_frame_states(
454 instructions,
455 initial_locals,
456 local_hints,
457 max_locals as usize,
458 constant_pool,
459 context,
460 exception_table,
461 )?;
462
463 Ok((usize::from(prefix_len), analysis))
464}
465
466fn shift_exception_table(
467 exception_table: &mut [ExceptionTableEntry],
468 amount: u16,
469 context: &str,
470) -> jvm::Result<()> {
471 for entry in exception_table {
472 entry.range_pc.start = entry.range_pc.start.checked_add(amount).ok_or_else(|| {
473 jvm::Error::VerificationError {
474 context: context.to_string(),
475 message: "exception range start overflowed while inserting a prefix".to_string(),
476 }
477 })?;
478 entry.range_pc.end = entry.range_pc.end.checked_add(amount).ok_or_else(|| {
479 jvm::Error::VerificationError {
480 context: context.to_string(),
481 message: "exception range end overflowed while inserting a prefix".to_string(),
482 }
483 })?;
484 entry.handler_pc =
485 entry
486 .handler_pc
487 .checked_add(amount)
488 .ok_or_else(|| jvm::Error::VerificationError {
489 context: context.to_string(),
490 message: "exception handler overflowed while inserting a prefix".to_string(),
491 })?;
492 }
493 Ok(())
494}
495
496fn loaded_local(instruction: &Instruction) -> Option<(u16, FrameValue)> {

Callers 1

solve_frame_statesFunction · 0.85

Calls 15

frame_value_from_ldcFunction · 0.85
frame_value_from_ldc2Function · 0.85
store_fixedFunction · 0.85
store_reference_fixedFunction · 0.85
array_loadFunction · 0.85
array_component_valueFunction · 0.85
binaryFunction · 0.85
unaryFunction · 0.85
shiftFunction · 0.85
convertFunction · 0.85
branch_successorsFunction · 0.85

Tested by

no test coverage detected