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

Method load_local

src/lower2/stackmaps.rs:100–133  ·  view source on GitHub ↗
(
        &mut self,
        index: u16,
        local_hints: &[FrameValue],
        load_hint: FrameValue,
        context: &str,
        instruction_index: usize,
    )

Source from the content-addressed store, hash-verified

98 context: &str,
99 instruction_index: usize,
100 ) -> jvm::Result<FrameValue> {
101 let value = self.pop_category1(context, instruction_index)?;
102 if !value.is_reference_like() && value != FrameValue::Top {
103 return Err(jvm::Error::VerificationError {
104 context: context.to_string(),
105 message: format!(
106 "Expected reference value at instruction {instruction_index}, found {value:?}"
107 ),
108 });
109 }
110 Ok(value)
111 }
112
113 fn load_local(
114 &mut self,
115 index: u16,
116 local_hints: &[FrameValue],
117 load_hint: FrameValue,
118 context: &str,
119 instruction_index: usize,
120 ) -> jvm::Result<()> {
121 let mut value = self
122 .locals
123 .get(index as usize)
124 .cloned()
125 .unwrap_or(FrameValue::Top);
126 if value == FrameValue::Top {
127 value = local_hints
128 .get(index as usize)
129 .cloned()
130 .unwrap_or(FrameValue::Top);
131 if value == FrameValue::Top {
132 value = load_hint;
133 if value == FrameValue::Top {
134 return Err(jvm::Error::VerificationError {
135 context: context.to_string(),
136 message: format!(

Callers 1

transfer_instructionFunction · 0.80

Calls 2

to_stringMethod · 0.80
store_localMethod · 0.80

Tested by

no test coverage detected