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

Function get_shift_amount

src/oomir/interpret.rs:657–668  ·  view source on GitHub ↗

Helper for shift amount conversion (must be usize for BigInt shifts)

(op2: &Constant)

Source from the content-addressed store, hash-verified

655 match array {
656 Constant::Array(_, elems) => Some(Constant::I32(
657 elems.len().try_into().ok().unwrap_or(i32::MAX), // Handle potential overflow
658 )),
659 _ => None, // Not an array
660 }
661}
662
663pub fn get_field_constant(instance: Constant, field_name: String) -> Option<Constant> {
664 match instance {
665 Constant::Instance { fields, .. } => fields.get(&field_name).cloned(),
666 _ => None, // Not an instance or doesn't have fields map
667 }
668}
669
670impl Constant {
671 fn as_i8(&self) -> Option<i8> {

Callers 2

shl_constantsFunction · 0.85
shr_constantsFunction · 0.85

Calls 1

parse_constant_to_bigintFunction · 0.85

Tested by

no test coverage detected