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

Method to_string

src/oomir.rs:296–318  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

294 if matches!(ty, Type::Pointer(_)) {
295 has_pointer = true;
296 5u16
297 } else if matches!(ty, Type::I64 | Type::U64 | Type::F64) {
298 2
299 } else {
300 1
301 }
302 })
303 .sum::<u16>();
304 // JVMS 4.3.3 limits a method descriptor to 255 parameter units;
305 // instance methods also consume one unit for the receiver.
306 has_pointer && slots + u16::from(!self.is_static) <= 255
307 }
308
309 /// Replaces all occurrences of `Type::Class(old_name)` with `Type::Class(new_name)`
310 /// in the signature's parameters and return type.
311 /// Returns a tuple (params_changed, return_changed) indicating whether any replacements were made.
312 pub fn replace_class_in_signature(
313 &mut self,
314 old_class_name: &str,
315 new_class_name: &str,
316 ) -> (bool, bool) {
317 let mut params_changed = false;
318 let mut return_changed = false;
319
320 // Replace in parameters
321 for (_param_name, param_type) in self.params.iter_mut() {

Callers 15

oomir_to_jvm_bytecodeFunction · 0.80
to_jvm_descriptorMethod · 0.80
to_jvm_internal_nameMethod · 0.80
from_constantMethod · 0.80
replace_classMethod · 0.80
codegen_crateMethod · 0.80
mir_to_oomirFunction · 0.80

Calls 1

to_jvm_descriptorMethod · 0.80

Tested by

no test coverage detected