diff --git a/androscalpel/src/apk.rs b/androscalpel/src/apk.rs index 7992c7b..3278e20 100644 --- a/androscalpel/src/apk.rs +++ b/androscalpel/src/apk.rs @@ -304,7 +304,7 @@ impl Apk { } array_aux }; - let method_handle = if let DexValue::MethodHandle(handle) = array[0] { + let method_handle = if let DexValue::MethodHandle(handle) = &array[0] { handle } else { bail!( @@ -313,7 +313,7 @@ impl Apk { array[0] ) }; - let name = if let DexValue::String(string) = array[1] { + let name = if let DexValue::String(string) = &array[1] { string } else { bail!( @@ -322,7 +322,7 @@ impl Apk { array[1] ) }; - let proto = if let DexValue::MethodType(ty) = array[0] { + let proto = if let DexValue::MethodType(ty) = &array[0] { ty } else { bail!( @@ -332,7 +332,12 @@ impl Apk { ) }; let args = array[3..].to_vec(); - Ok(CallSite::new(method_handle, name, proto, args)) + Ok(CallSite::new( + method_handle.clone(), + name.clone(), + proto.clone(), + args, + )) } /// Return a [`Vec`] for the offset of an [`AnnotationSetItem`]. @@ -733,7 +738,7 @@ impl Apk { /// Convert an instruction format to an instruction. fn instruction_format_to_instruction( - format: InsFormat, + format: &InsFormat, addr: usize, insns_ref: &HashMap, dex: &DexFileReader, @@ -741,7 +746,7 @@ impl Apk { use crate::instructions::*; use InsFormat::*; let mut labels = HashMap::new(); - let ins = match format { + let ins = match format.clone() { Format10X { op: 0x00 } => Instruction::Nop(Nop::new()), Format12X { op: 0x01, va, vb } => Instruction::Move(Move::new(va as u16, vb as u16)), Format22X { op: 0x02, va, vb } => Instruction::Move(Move::new(va as u16, vb)), @@ -877,7 +882,7 @@ impl Apk { addr - (-a as usize) }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -895,7 +900,7 @@ impl Apk { addr - (-a as usize) }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -913,7 +918,7 @@ impl Apk { addr - (-a as usize) }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -950,7 +955,7 @@ impl Apk { addr - (-target as usize) }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!( @@ -1004,7 +1009,7 @@ impl Apk { addr - (-target as usize) }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!( @@ -1014,7 +1019,6 @@ impl Apk { } } branches.insert(key, label); - key += 1; } Instruction::Switch(Switch::new(va, branches)) } else { @@ -1078,7 +1082,7 @@ impl Apk { addr - c as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1104,7 +1108,7 @@ impl Apk { addr - c as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1130,7 +1134,7 @@ impl Apk { addr - c as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1156,7 +1160,7 @@ impl Apk { addr - c as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1182,7 +1186,7 @@ impl Apk { addr - c as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1208,7 +1212,7 @@ impl Apk { addr - c as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1229,7 +1233,7 @@ impl Apk { addr - b as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1250,7 +1254,7 @@ impl Apk { addr - b as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1271,7 +1275,7 @@ impl Apk { addr - b as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1292,7 +1296,7 @@ impl Apk { addr - b as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1313,7 +1317,7 @@ impl Apk { addr - b as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -1334,7 +1338,7 @@ impl Apk { addr - b as usize }; let label = format!("label_{dest_addr:80X}"); - if let Some(old_label) = labels.insert(dest_addr, label) { + if let Some(old_label) = labels.insert(dest_addr, label.clone()) { if old_label != label { // TODO: internal error, panic? bail!("There is already a label at 0x{dest_addr:80X} with an invalid name"); @@ -2187,9 +2191,9 @@ impl Apk { "Inconsistant code_item: found try blocks but no handler list" ))? .get_handler_at_offset(handler_off)?; - let default_handler = if let Some(Uleb128(addr)) = catch_all_addr.clone() { + let default_handler = if let Some(Uleb128(addr)) = *catch_all_addr { let label = format!("label_{addr:80X}"); - if let Some(label_) = labels.insert(addr as usize, label) { + if let Some(label_) = labels.insert(addr as usize, label.clone()) { if label_ != label { bail!("Label collision at 0x{addr:80X}: {label_} and {label}"); } @@ -2205,7 +2209,7 @@ impl Apk { } in handlers.iter().cloned() { let label = format!("label_{addr:80X}"); - if let Some(label_) = labels.insert(addr as usize, label) { + if let Some(label_) = labels.insert(addr as usize, label.clone()) { if label_ != label { bail!("Label collision at 0x{addr:80X}: {label_} and {label}"); } @@ -2215,7 +2219,7 @@ impl Apk { let dest_addr = start_addr + insn_count as u32; let end_label = format!("label_{dest_addr:80X}"); let try_ = Instruction::Try(Try::new(end_label, handlers_, default_handler)); - if let Some(try__) = tries.insert(start_addr as usize, try_) { + if let Some(try__) = tries.insert(start_addr as usize, try_.clone()) { bail!( "Found two try blocks at the same address 0x{start_addr:80X}: \ {try__:?}, {try_:?}" @@ -2231,14 +2235,14 @@ impl Apk { } let mut instructions = vec![]; addr = 0; - for ins_f in code_item.insns { + for ins_f in &code_item.insns { let (ins, ins_labels) = Self::instruction_format_to_instruction(ins_f, addr, &instructions_raw, dex)?; instructions.push((addr, ins)); addr += ins_f.size() / 2; - for (key, val) in ins_labels { - if let Some(val_) = ins_labels.get(&key) { - if val_ != &val { + for (key, val) in &ins_labels { + if let Some(val_) = ins_labels.get(key) { + if val_ != val { // TODO: internal error, panic? bail!("Label collision at 0x{key:80X}: {val_} and {val}"); } diff --git a/androscalpel/src/dex_writer.rs b/androscalpel/src/dex_writer.rs index ee6a864..f52df29 100644 --- a/androscalpel/src/dex_writer.rs +++ b/androscalpel/src/dex_writer.rs @@ -11,6 +11,10 @@ use crate::Result; use crate::*; use androscalpel_serializer::*; +use crate::instructions::*; +use crate::Instruction; +use androscalpel_serializer::Instruction as InsFormat; + #[derive(Debug, Clone)] pub struct DexWriter { header: HeaderItem, @@ -38,7 +42,8 @@ pub struct DexWriter { /// Once the class definitions are sorted, the values are set to the classes and there /// index in the `class_defs` section. class_defs: HashMap, - // call_site_ids: // TODO: parsing code insns + /// The call sites refered to in the bytecode. + call_sites: Vec, /// A struct that keep track of sections size, nb elements and offsets. section_manager: SectionManager, /// The string_data section. Once populated, the elements must be sorted according to the spec. @@ -120,6 +125,7 @@ impl Default for DexWriter { field_ids: HashMap::new(), method_ids: HashMap::new(), class_defs: HashMap::new(), + call_sites: vec![], section_manager: SectionManager::default(), string_data_list: vec![], type_ids_list: vec![], @@ -357,6 +363,7 @@ impl DexWriter { .code .as_ref() .unwrap() + .clone() } else { self.class_defs .get(&method_id.class_) @@ -368,7 +375,882 @@ impl DexWriter { .code .as_ref() .unwrap() + .clone() }; + + let mut min_addr = 0; + let mut max_addr = 0; + let mut label_min_max_addrs: HashMap = HashMap::new(); + for ins in &code.insns { + match ins { + Instruction::Label(Label { name }) => { + label_min_max_addrs.insert(name.clone(), (min_addr, max_addr)); + min_addr += ins.min_ins_size() / 2; + max_addr += ins.max_ins_size() / 2; + } + Instruction::ConstString(ins) => { + let string_idx = self.strings.get(&ins.lit).ok_or(anyhow!( + "String {} (found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let size = ins.get_raw_ins(*string_idx).size() / 2; + min_addr += size; + max_addr += size; + } + _ => { + min_addr += ins.min_ins_size() / 2; + max_addr += ins.max_ins_size() / 2; + } + } + } + let mut addr = 0; + let mut label_addrs = HashMap::new(); + let mut goto_sizes = vec![]; + for ins in &code.insns { + match ins { + Instruction::Label(Label { name }) => { + label_addrs.insert(name.clone(), addr); + addr += ins.max_ins_size() / 2; + } + Instruction::ConstString(ins) => { + let string_idx = self.strings.get(&ins.lit).ok_or(anyhow!( + "String {} (found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + addr += ins.get_raw_ins(*string_idx).size() / 2; + } + Instruction::Goto(Goto { label }) => { + let (min_addr, max_addr) = label_min_max_addrs + .get(label) + .ok_or(anyhow!("Label {label} not found in label estimation map"))?; + let size = Goto::size_from_branch_offset_interval(addr, *min_addr, *max_addr)?; + goto_sizes.push(size); + addr += size / 2; + } + _ => addr += ins.ins_size()? / 2, + } + } + let mut insns = vec![]; + let mut payloads = vec![]; + let mut goto_idx = 0; + let mut payload_addr = addr; + addr = 0; + for ins in &code.insns { + match ins { + Instruction::ConstString(ins) => { + let string_idx = self.strings.get(&ins.lit).ok_or(anyhow!( + "String {} (found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*string_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::ConstClass(ins) => { + let class_idx = *self.type_ids.get(&ins.lit).ok_or(anyhow!( + "Class {} (type of class found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(class_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::CheckCast(ins) => { + let class_idx = *self.type_ids.get(&ins.lit).ok_or(anyhow!( + "Class {} (type of class found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(class_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InstanceOf(ins) => { + let class_idx = *self.type_ids.get(&ins.lit).ok_or(anyhow!( + "Class {} (type of class found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(class_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::NewInstance(ins) => { + let class_idx = *self.type_ids.get(&ins.lit).ok_or(anyhow!( + "Class {} (type of class found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(class_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::NewArray(ins) => { + let class_idx = *self.type_ids.get(&ins.lit).ok_or(anyhow!( + "Type {} (type found in code of {}) not found in dex builder", + ins.lit.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(class_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::FilledNewArray(ins) => { + let class_idx = *self.type_ids.get(&ins.type_).ok_or(anyhow!( + "Type {} (type found in code of {}) not found in dex builder", + ins.type_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(class_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::FillArrayData(ins) => { + let payload = InsFormat::FormatFillArrayDataPayload { + elt_width: ins.elt_width, + data: ins.data.clone(), + }; + let data_offset = payload_addr as i32 - addr as i32; + payload_addr += payload.size() / 2; + payloads.push(payload); + let ins = ins.get_raw_ins(data_offset); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::Goto(ins) => { + let goto_size = goto_sizes[goto_idx]; + goto_idx += 1; + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found goto with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + let ins = ins.get_raw_ins(branch_offset, goto_size); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::Switch(ins) => { + let mut key_targets = vec![]; + for (key, label) in &ins.branches { + let label_addr = label_addrs.get(label).ok_or(anyhow!( + "Label {} not found in code of {}, but found goto with this label", + label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + key_targets.push((*key, branch_offset)); + } + key_targets.sort_by_key(|(key, _)| *key); + let payload = if ins.is_packed() { + let (first_key, _) = *key_targets.first().ok_or(anyhow!( + "Found empty swithc in code of {}", + method_id.__repr__() + ))?; + let targets: Vec<_> = + key_targets.into_iter().map(|(_, target)| target).collect(); + InsFormat::FormatPackedSwitchPayload { first_key, targets } + } else { + InsFormat::FormatSparseSwitchPayload { key_targets } + }; + let data_offset = payload_addr as i32 - addr as i32; + payload_addr += payload.size() / 2; + payloads.push(payload); + let ins = ins.get_raw_ins(data_offset); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfEq(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfNe(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfLt(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfGe(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfGt(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfLe(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfEqZ(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfNeZ(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfLtZ(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfGeZ(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfGtZ(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IfLeZ(ins) => { + let label_addr = label_addrs.get(&ins.label).ok_or(anyhow!( + "Label {} not found in code of {}, but found if with this label", + ins.label, + method_id.__repr__() + ))?; + let branch_offset = *label_addr as i32 - addr as i32; + if branch_offset > i16::MAX as i32 || branch_offset < i16::MIN as i32 { + bail!( + "Found an if that jump to far from the instruction in code of {}", + method_id.__repr__() + ); + } + let ins = ins.get_raw_ins(branch_offset as i16); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGet(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGetWide(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGetObject(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGetBoolean(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGetByte(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGetChar(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IGetShort(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPut(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPutWide(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPutObject(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPutBoolean(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPutByte(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPutChar(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::IPutShort(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGet(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGetWide(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGetObject(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGetBoolean(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGetByte(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGetChar(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SGetShort(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPut(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPutWide(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPutObject(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPutBoolean(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPutByte(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPutChar(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::SPutShort(ins) => { + let field = &ins.field; + let field_idx = self.field_ids.get(field).ok_or(anyhow!( + "Field {} (field of class {}, found in code of {}) not found in dex builder", + field.__repr__(), + field.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*field_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokeVirtual(ins) => { + let meth = &ins.method; + let meth_idx = self.method_ids.get(meth).ok_or(anyhow!( + "Method {} (method of class {}, found in code of {}) not found in dex builder", + meth.__repr__(), + meth.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*meth_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokeSuper(ins) => { + let meth = &ins.method; + let meth_idx = self.method_ids.get(meth).ok_or(anyhow!( + "Method {} (method of class {}, found in code of {}) not found in dex builder", + meth.__repr__(), + meth.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*meth_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokeDirect(ins) => { + let meth = &ins.method; + let meth_idx = self.method_ids.get(meth).ok_or(anyhow!( + "Method {} (method of class {}, found in code of {}) not found in dex builder", + meth.__repr__(), + meth.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*meth_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokeStatic(ins) => { + let meth = &ins.method; + let meth_idx = self.method_ids.get(meth).ok_or(anyhow!( + "Method {} (method of class {}, found in code of {}) not found in dex builder", + meth.__repr__(), + meth.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*meth_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokeInterface(ins) => { + let meth = &ins.method; + let meth_idx = self.method_ids.get(meth).ok_or(anyhow!( + "Method {} (method of class {}, found in code of {}) not found in dex builder", + meth.__repr__(), + meth.class_.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*meth_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokePolymorphic(ins) => { + let meth = &ins.method; + let meth_idx = self.method_ids.get(meth).ok_or(anyhow!( + "Method {} (method of class {}, found in code of {}) not found in dex builder", + meth.__repr__(), + meth.class_.__repr__(), + method_id.__repr__() + ))?; + let proto_idx = self.proto_ids.get(&ins.proto).ok_or(anyhow!( + "Prototype {} (found in code of {}) not found in dex builder", + ins.proto.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*meth_idx, *proto_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::InvokeCustom(ins) => { + let call_site_idx = self.call_sites.len(); + self.call_sites.push(ins.call_site.clone()); + let ins = ins.get_raw_ins(call_site_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::ConstMethodHandle(ins) => { + let method_handle_idx = self.method_handles.len(); + self.insert_method_handle(&ins.handle)?; + let ins = ins.get_raw_ins(method_handle_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::ConstMethodType(ins) => { + let proto_idx = self.proto_ids.get(&ins.proto).ok_or(anyhow!( + "Prototype {} (found in code of {}) not found in dex builder", + ins.proto.__repr__(), + method_id.__repr__() + ))?; + let ins = ins.get_raw_ins(*proto_idx); + addr += ins.size() / 2; + insns.push(ins); + } + Instruction::Try(_ins) => { + // TODO + } + Instruction::Label(_) => (), + _ => { + let ins = ins.get_raw_ins().with_context(|| { + format!( + "Failed to convert instruction {} (found in code of {}) to raw instruction", + ins.__repr__(), + method_id.__repr__() + ) + })?; + addr += ins.size() / 2; + insns.push(ins); + } + } + } + insns.extend(payloads); + + // TODO + let mut tries = vec![]; + let mut handlers = None; + + let debug_info_off = if code.debug_info.is_empty() { + 0 + } else { + let debug_info_off = self.section_manager.get_size(Section::DebugInfoItem); + let item = DebugInfoItem::deserialize_from_slice(&code.debug_info)?; + self.section_manager + .add_elt(Section::DebugInfoItem, Some(item.size())); + self.debug_info_items.push(item); + debug_info_off + 1 + }; + let item = CodeItem { + registers_size: code.registers_size, + ins_size: code.ins_size, + outs_size: code.outs_size, + debug_info_off, // linked in link_debug_info() + insns, + tries, + handlers, + }; + self.section_manager + .add_elt(Section::CodeItem, Some(item.size())); + self.code_items.push(item); + /* let mut tries = vec![]; let mut local_off = 0; let mut handler_offsets = HashMap::new(); @@ -412,28 +1294,7 @@ impl DexWriter { } else { Some(handler_list) }; - let debug_info_off = if code.debug_info.is_empty() { - 0 - } else { - let debug_info_off = self.section_manager.get_size(Section::DebugInfoItem); - let item = DebugInfoItem::deserialize_from_slice(&code.debug_info)?; - self.section_manager - .add_elt(Section::DebugInfoItem, Some(item.size())); - self.debug_info_items.push(item); - debug_info_off + 1 - }; - let item = CodeItem { - registers_size: code.registers_size, - ins_size: code.ins_size, - outs_size: code.outs_size, - debug_info_off, // linked in link_debug_info() - insns: code.insns.clone(), - tries, - handlers, - }; - self.section_manager - .add_elt(Section::CodeItem, Some(item.size())); - self.code_items.push(item); + */ Ok(()) } @@ -566,6 +1427,82 @@ impl DexWriter { Ok(()) } + /// Insert a [`MethodHandle`]. + pub fn insert_method_handle(&mut self, handle: &MethodHandle) -> Result<()> { + let (field_or_method_id, method_handle_type) = match handle { + MethodHandle::StaticPut(StaticPut(field)) => ( + *self.field_ids.get(field).ok_or(anyhow!( + "Field {} not found in dex writer", + field.__repr__() + ))? as u16, + MethodHandleType::StaticPut, + ), + MethodHandle::StaticGet(StaticGet(field)) => ( + *self.field_ids.get(field).ok_or(anyhow!( + "Field {} not found in dex writer", + field.__repr__() + ))? as u16, + MethodHandleType::StaticGet, + ), + MethodHandle::InstancePut(InstancePut(field)) => ( + *self.field_ids.get(field).ok_or(anyhow!( + "Field {} not found in dex writer", + field.__repr__() + ))? as u16, + MethodHandleType::InstancePut, + ), + MethodHandle::InstanceGet(InstanceGet(field)) => ( + *self.field_ids.get(field).ok_or(anyhow!( + "Field {} not found in dex writer", + field.__repr__() + ))? as u16, + MethodHandleType::InstanceGet, + ), + MethodHandle::InvokeStatic(InvokeStatic(meth)) => ( + *self.method_ids.get(meth).ok_or(anyhow!( + "Method {} not found in dex writer", + meth.__repr__() + ))? as u16, + MethodHandleType::InvokeStatic, + ), + MethodHandle::InvokeInstance(InvokeInstance(meth)) => ( + *self.method_ids.get(meth).ok_or(anyhow!( + "Method {} not found in dex writer", + meth.__repr__() + ))? as u16, + MethodHandleType::InvokeInstance, + ), + MethodHandle::InvokeConstructor(InvokeConstructor(meth)) => ( + *self.method_ids.get(meth).ok_or(anyhow!( + "Method {} not found in dex writer", + meth.__repr__() + ))? as u16, + MethodHandleType::InvokeConstructor, + ), + MethodHandle::InvokeDirect(InvokeDirect(meth)) => ( + *self.method_ids.get(meth).ok_or(anyhow!( + "Method {} not found in dex writer", + meth.__repr__() + ))? as u16, + MethodHandleType::InvokeDirect, + ), + MethodHandle::InvokeInterface(InvokeInterface(meth)) => ( + *self.method_ids.get(meth).ok_or(anyhow!( + "Method {} not found in dex writer", + meth.__repr__() + ))? as u16, + MethodHandleType::InvokeInterface, + ), + }; + self.method_handles.push(MethodHandleItem { + method_handle_type, + field_or_method_id, + unused1: 0, + unused2: 0, + }); + Ok(()) + } + /// Convert a [`DexValue`] to an [`EncodedValue`]. /// /// # Warning @@ -589,77 +1526,7 @@ impl DexWriter { DexValue::MethodHandle(val) => { // TODO: move to a method let idx = self.method_handles.len() as u32; - let (field_or_method_id, method_handle_type) = match val { - MethodHandle::StaticPut(StaticPut(field)) => ( - *self.field_ids.get(field).ok_or(anyhow!( - "Field {} not found in dex writer", - field.__repr__() - ))? as u16, - MethodHandleType::StaticPut, - ), - MethodHandle::StaticGet(StaticGet(field)) => ( - *self.field_ids.get(field).ok_or(anyhow!( - "Field {} not found in dex writer", - field.__repr__() - ))? as u16, - MethodHandleType::StaticGet, - ), - MethodHandle::InstancePut(InstancePut(field)) => ( - *self.field_ids.get(field).ok_or(anyhow!( - "Field {} not found in dex writer", - field.__repr__() - ))? as u16, - MethodHandleType::InstancePut, - ), - MethodHandle::InstanceGet(InstanceGet(field)) => ( - *self.field_ids.get(field).ok_or(anyhow!( - "Field {} not found in dex writer", - field.__repr__() - ))? as u16, - MethodHandleType::InstanceGet, - ), - MethodHandle::InvokeStatic(InvokeStatic(meth)) => ( - *self.method_ids.get(meth).ok_or(anyhow!( - "Method {} not found in dex writer", - meth.__repr__() - ))? as u16, - MethodHandleType::InvokeStatic, - ), - MethodHandle::InvokeInstance(InvokeInstance(meth)) => ( - *self.method_ids.get(meth).ok_or(anyhow!( - "Method {} not found in dex writer", - meth.__repr__() - ))? as u16, - MethodHandleType::InvokeInstance, - ), - MethodHandle::InvokeConstructor(InvokeConstructor(meth)) => ( - *self.method_ids.get(meth).ok_or(anyhow!( - "Method {} not found in dex writer", - meth.__repr__() - ))? as u16, - MethodHandleType::InvokeConstructor, - ), - MethodHandle::InvokeDirect(InvokeDirect(meth)) => ( - *self.method_ids.get(meth).ok_or(anyhow!( - "Method {} not found in dex writer", - meth.__repr__() - ))? as u16, - MethodHandleType::InvokeDirect, - ), - MethodHandle::InvokeInterface(InvokeInterface(meth)) => ( - *self.method_ids.get(meth).ok_or(anyhow!( - "Method {} not found in dex writer", - meth.__repr__() - ))? as u16, - MethodHandleType::InvokeInterface, - ), - }; - self.method_handles.push(MethodHandleItem { - method_handle_type, - field_or_method_id, - unused1: 0, - unused2: 0, - }); + self.insert_method_handle(val)?; Ok(EncodedValue::MethodHandle(idx)) } DexValue::String(val) => Ok(EncodedValue::String( @@ -1511,7 +2378,7 @@ impl DexWriter { for class_def in &self.class_defs_list { class_def.serialize(writer)?; } - // TODO: CallSiteIdItem, + // TODO: CallSiteIdItem, data must be inserted as encoded array item later // MethodHandleItem section for handle in &self.method_handles { handle.serialize(writer)?; diff --git a/androscalpel/src/instructions.rs b/androscalpel/src/instructions.rs index 7ba537f..85cf297 100644 --- a/androscalpel/src/instructions.rs +++ b/androscalpel/src/instructions.rs @@ -621,6 +621,1042 @@ impl Instruction { Self::Label(ins) => ins.__repr__(), } } + + /// Return the smallest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn min_ins_size(&self) -> usize { + match self { + Self::Nop(ins) => ins.min_ins_size(), + Self::Move(ins) => ins.min_ins_size(), + Self::MoveWide(ins) => ins.min_ins_size(), + Self::MoveObject(ins) => ins.min_ins_size(), + Self::MoveResult(ins) => ins.min_ins_size(), + Self::MoveResultWide(ins) => ins.min_ins_size(), + Self::MoveException(ins) => ins.min_ins_size(), + Self::MoveResultObject(ins) => ins.min_ins_size(), + Self::ReturnVoid(ins) => ins.min_ins_size(), + Self::Return(ins) => ins.min_ins_size(), + Self::ReturnWide(ins) => ins.min_ins_size(), + Self::ReturnObject(ins) => ins.min_ins_size(), + Self::Const(ins) => ins.min_ins_size(), + Self::ConstWide(ins) => ins.min_ins_size(), + Self::ConstString(ins) => ins.min_ins_size(), + Self::ConstClass(ins) => ins.min_ins_size(), + Self::MonitorEnter(ins) => ins.min_ins_size(), + Self::MonitorExit(ins) => ins.min_ins_size(), + Self::CheckCast(ins) => ins.min_ins_size(), + Self::InstanceOf(ins) => ins.min_ins_size(), + Self::ArrayLength(ins) => ins.min_ins_size(), + Self::NewInstance(ins) => ins.min_ins_size(), + Self::NewArray(ins) => ins.min_ins_size(), + Self::FilledNewArray(ins) => ins.min_ins_size(), + Self::FillArrayData(ins) => ins.min_ins_size(), + Self::Throw(ins) => ins.min_ins_size(), + Self::Goto(ins) => ins.min_ins_size(), + Self::Switch(ins) => ins.min_ins_size(), + Self::CmpLFloat(ins) => ins.min_ins_size(), + Self::CmpGFloat(ins) => ins.min_ins_size(), + Self::CmpLDouble(ins) => ins.min_ins_size(), + Self::CmpGDouble(ins) => ins.min_ins_size(), + Self::CmpLong(ins) => ins.min_ins_size(), + Self::IfEq(ins) => ins.min_ins_size(), + Self::IfNe(ins) => ins.min_ins_size(), + Self::IfLt(ins) => ins.min_ins_size(), + Self::IfGe(ins) => ins.min_ins_size(), + Self::IfGt(ins) => ins.min_ins_size(), + Self::IfLe(ins) => ins.min_ins_size(), + Self::IfEqZ(ins) => ins.min_ins_size(), + Self::IfNeZ(ins) => ins.min_ins_size(), + Self::IfLtZ(ins) => ins.min_ins_size(), + Self::IfGeZ(ins) => ins.min_ins_size(), + Self::IfGtZ(ins) => ins.min_ins_size(), + Self::IfLeZ(ins) => ins.min_ins_size(), + Self::AGet(ins) => ins.min_ins_size(), + Self::AGetWide(ins) => ins.min_ins_size(), + Self::AGetObject(ins) => ins.min_ins_size(), + Self::AGetBoolean(ins) => ins.min_ins_size(), + Self::AGetByte(ins) => ins.min_ins_size(), + Self::AGetChar(ins) => ins.min_ins_size(), + Self::AGetShort(ins) => ins.min_ins_size(), + Self::APut(ins) => ins.min_ins_size(), + Self::APutWide(ins) => ins.min_ins_size(), + Self::APutObject(ins) => ins.min_ins_size(), + Self::APutBoolean(ins) => ins.min_ins_size(), + Self::APutByte(ins) => ins.min_ins_size(), + Self::APutChar(ins) => ins.min_ins_size(), + Self::APutShort(ins) => ins.min_ins_size(), + Self::IGet(ins) => ins.min_ins_size(), + Self::IGetWide(ins) => ins.min_ins_size(), + Self::IGetObject(ins) => ins.min_ins_size(), + Self::IGetBoolean(ins) => ins.min_ins_size(), + Self::IGetByte(ins) => ins.min_ins_size(), + Self::IGetChar(ins) => ins.min_ins_size(), + Self::IGetShort(ins) => ins.min_ins_size(), + Self::IPut(ins) => ins.min_ins_size(), + Self::IPutWide(ins) => ins.min_ins_size(), + Self::IPutObject(ins) => ins.min_ins_size(), + Self::IPutBoolean(ins) => ins.min_ins_size(), + Self::IPutByte(ins) => ins.min_ins_size(), + Self::IPutChar(ins) => ins.min_ins_size(), + Self::IPutShort(ins) => ins.min_ins_size(), + Self::SGet(ins) => ins.min_ins_size(), + Self::SGetWide(ins) => ins.min_ins_size(), + Self::SGetObject(ins) => ins.min_ins_size(), + Self::SGetBoolean(ins) => ins.min_ins_size(), + Self::SGetByte(ins) => ins.min_ins_size(), + Self::SGetChar(ins) => ins.min_ins_size(), + Self::SGetShort(ins) => ins.min_ins_size(), + Self::SPut(ins) => ins.min_ins_size(), + Self::SPutWide(ins) => ins.min_ins_size(), + Self::SPutObject(ins) => ins.min_ins_size(), + Self::SPutBoolean(ins) => ins.min_ins_size(), + Self::SPutByte(ins) => ins.min_ins_size(), + Self::SPutChar(ins) => ins.min_ins_size(), + Self::SPutShort(ins) => ins.min_ins_size(), + Self::InvokeVirtual(ins) => ins.min_ins_size(), + Self::InvokeSuper(ins) => ins.min_ins_size(), + Self::InvokeDirect(ins) => ins.min_ins_size(), + Self::InvokeStatic(ins) => ins.min_ins_size(), + Self::InvokeInterface(ins) => ins.min_ins_size(), + Self::NegInt(ins) => ins.min_ins_size(), + Self::NotInt(ins) => ins.min_ins_size(), + Self::NegLong(ins) => ins.min_ins_size(), + Self::NotLong(ins) => ins.min_ins_size(), + Self::NegFloat(ins) => ins.min_ins_size(), + Self::NegDouble(ins) => ins.min_ins_size(), + Self::IntToLong(ins) => ins.min_ins_size(), + Self::IntToFloat(ins) => ins.min_ins_size(), + Self::IntToDouble(ins) => ins.min_ins_size(), + Self::LongToInt(ins) => ins.min_ins_size(), + Self::LongToFloat(ins) => ins.min_ins_size(), + Self::LongToDouble(ins) => ins.min_ins_size(), + Self::FloatToInt(ins) => ins.min_ins_size(), + Self::FloatToLong(ins) => ins.min_ins_size(), + Self::FloatToDouble(ins) => ins.min_ins_size(), + Self::DoubleToInt(ins) => ins.min_ins_size(), + Self::DoubleToLong(ins) => ins.min_ins_size(), + Self::DoubleToFloat(ins) => ins.min_ins_size(), + Self::IntToByte(ins) => ins.min_ins_size(), + Self::IntToChar(ins) => ins.min_ins_size(), + Self::IntToShort(ins) => ins.min_ins_size(), + Self::AddInt(ins) => ins.min_ins_size(), + Self::SubInt(ins) => ins.min_ins_size(), + Self::MulInt(ins) => ins.min_ins_size(), + Self::DivInt(ins) => ins.min_ins_size(), + Self::RemInt(ins) => ins.min_ins_size(), + Self::AndInt(ins) => ins.min_ins_size(), + Self::OrInt(ins) => ins.min_ins_size(), + Self::XorInt(ins) => ins.min_ins_size(), + Self::ShlInt(ins) => ins.min_ins_size(), + Self::ShrInt(ins) => ins.min_ins_size(), + Self::UshrInt(ins) => ins.min_ins_size(), + Self::AddLong(ins) => ins.min_ins_size(), + Self::SubLong(ins) => ins.min_ins_size(), + Self::MulLong(ins) => ins.min_ins_size(), + Self::DivLong(ins) => ins.min_ins_size(), + Self::RemLong(ins) => ins.min_ins_size(), + Self::AndLong(ins) => ins.min_ins_size(), + Self::OrLong(ins) => ins.min_ins_size(), + Self::XorLong(ins) => ins.min_ins_size(), + Self::ShlLong(ins) => ins.min_ins_size(), + Self::ShrLong(ins) => ins.min_ins_size(), + Self::UshrLong(ins) => ins.min_ins_size(), + Self::AddFloat(ins) => ins.min_ins_size(), + Self::SubFloat(ins) => ins.min_ins_size(), + Self::MulFloat(ins) => ins.min_ins_size(), + Self::DivFloat(ins) => ins.min_ins_size(), + Self::RemFloat(ins) => ins.min_ins_size(), + Self::AddDouble(ins) => ins.min_ins_size(), + Self::SubDouble(ins) => ins.min_ins_size(), + Self::MulDouble(ins) => ins.min_ins_size(), + Self::DivDouble(ins) => ins.min_ins_size(), + Self::RemDouble(ins) => ins.min_ins_size(), + Self::AddInt2Addr(ins) => ins.min_ins_size(), + Self::SubInt2Addr(ins) => ins.min_ins_size(), + Self::MulInt2Addr(ins) => ins.min_ins_size(), + Self::DivInt2Addr(ins) => ins.min_ins_size(), + Self::RemInt2Addr(ins) => ins.min_ins_size(), + Self::AndInt2Addr(ins) => ins.min_ins_size(), + Self::OrInt2Addr(ins) => ins.min_ins_size(), + Self::XorInt2Addr(ins) => ins.min_ins_size(), + Self::ShlInt2Addr(ins) => ins.min_ins_size(), + Self::ShrInt2Addr(ins) => ins.min_ins_size(), + Self::UshrInt2Addr(ins) => ins.min_ins_size(), + Self::AddLong2Addr(ins) => ins.min_ins_size(), + Self::SubLong2Addr(ins) => ins.min_ins_size(), + Self::MulLong2Addr(ins) => ins.min_ins_size(), + Self::DivLong2Addr(ins) => ins.min_ins_size(), + Self::RemLong2Addr(ins) => ins.min_ins_size(), + Self::AndLong2Addr(ins) => ins.min_ins_size(), + Self::OrLong2Addr(ins) => ins.min_ins_size(), + Self::XorLong2Addr(ins) => ins.min_ins_size(), + Self::ShlLong2Addr(ins) => ins.min_ins_size(), + Self::ShrLong2Addr(ins) => ins.min_ins_size(), + Self::UshrLong2Addr(ins) => ins.min_ins_size(), + Self::AddFloat2Addr(ins) => ins.min_ins_size(), + Self::SubFloat2Addr(ins) => ins.min_ins_size(), + Self::MulFloat2Addr(ins) => ins.min_ins_size(), + Self::DivFloat2Addr(ins) => ins.min_ins_size(), + Self::RemFloat2Addr(ins) => ins.min_ins_size(), + Self::AddDouble2Addr(ins) => ins.min_ins_size(), + Self::SubDouble2Addr(ins) => ins.min_ins_size(), + Self::MulDouble2Addr(ins) => ins.min_ins_size(), + Self::DivDouble2Addr(ins) => ins.min_ins_size(), + Self::RemDouble2Addr(ins) => ins.min_ins_size(), + Self::AddIntLit(ins) => ins.min_ins_size(), + Self::RsubIntLit(ins) => ins.min_ins_size(), + Self::MulIntLit(ins) => ins.min_ins_size(), + Self::DivIntLit(ins) => ins.min_ins_size(), + Self::RemIntLit(ins) => ins.min_ins_size(), + Self::AndIntLit(ins) => ins.min_ins_size(), + Self::OrIntLit(ins) => ins.min_ins_size(), + Self::XorIntLit(ins) => ins.min_ins_size(), + Self::ShlIntLit(ins) => ins.min_ins_size(), + Self::ShrIntLit(ins) => ins.min_ins_size(), + Self::UshrIntLit(ins) => ins.min_ins_size(), + Self::InvokePolymorphic(ins) => ins.min_ins_size(), + Self::InvokeCustom(ins) => ins.min_ins_size(), + Self::ConstMethodHandle(ins) => ins.min_ins_size(), + Self::ConstMethodType(ins) => ins.min_ins_size(), + Self::Try(ins) => ins.min_ins_size(), + Self::Label(ins) => ins.min_ins_size(), + } + } + + /// Return the bigest size possible for the associated instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn max_ins_size(&self) -> usize { + match self { + Self::Nop(ins) => ins.max_ins_size(), + Self::Move(ins) => ins.max_ins_size(), + Self::MoveWide(ins) => ins.max_ins_size(), + Self::MoveObject(ins) => ins.max_ins_size(), + Self::MoveResult(ins) => ins.max_ins_size(), + Self::MoveResultWide(ins) => ins.max_ins_size(), + Self::MoveException(ins) => ins.max_ins_size(), + Self::MoveResultObject(ins) => ins.max_ins_size(), + Self::ReturnVoid(ins) => ins.max_ins_size(), + Self::Return(ins) => ins.max_ins_size(), + Self::ReturnWide(ins) => ins.max_ins_size(), + Self::ReturnObject(ins) => ins.max_ins_size(), + Self::Const(ins) => ins.max_ins_size(), + Self::ConstWide(ins) => ins.max_ins_size(), + Self::ConstString(ins) => ins.max_ins_size(), + Self::ConstClass(ins) => ins.max_ins_size(), + Self::MonitorEnter(ins) => ins.max_ins_size(), + Self::MonitorExit(ins) => ins.max_ins_size(), + Self::CheckCast(ins) => ins.max_ins_size(), + Self::InstanceOf(ins) => ins.max_ins_size(), + Self::ArrayLength(ins) => ins.max_ins_size(), + Self::NewInstance(ins) => ins.max_ins_size(), + Self::NewArray(ins) => ins.max_ins_size(), + Self::FilledNewArray(ins) => ins.max_ins_size(), + Self::FillArrayData(ins) => ins.max_ins_size(), + Self::Throw(ins) => ins.max_ins_size(), + Self::Goto(ins) => ins.max_ins_size(), + Self::Switch(ins) => ins.max_ins_size(), + Self::CmpLFloat(ins) => ins.max_ins_size(), + Self::CmpGFloat(ins) => ins.max_ins_size(), + Self::CmpLDouble(ins) => ins.max_ins_size(), + Self::CmpGDouble(ins) => ins.max_ins_size(), + Self::CmpLong(ins) => ins.max_ins_size(), + Self::IfEq(ins) => ins.max_ins_size(), + Self::IfNe(ins) => ins.max_ins_size(), + Self::IfLt(ins) => ins.max_ins_size(), + Self::IfGe(ins) => ins.max_ins_size(), + Self::IfGt(ins) => ins.max_ins_size(), + Self::IfLe(ins) => ins.max_ins_size(), + Self::IfEqZ(ins) => ins.max_ins_size(), + Self::IfNeZ(ins) => ins.max_ins_size(), + Self::IfLtZ(ins) => ins.max_ins_size(), + Self::IfGeZ(ins) => ins.max_ins_size(), + Self::IfGtZ(ins) => ins.max_ins_size(), + Self::IfLeZ(ins) => ins.max_ins_size(), + Self::AGet(ins) => ins.max_ins_size(), + Self::AGetWide(ins) => ins.max_ins_size(), + Self::AGetObject(ins) => ins.max_ins_size(), + Self::AGetBoolean(ins) => ins.max_ins_size(), + Self::AGetByte(ins) => ins.max_ins_size(), + Self::AGetChar(ins) => ins.max_ins_size(), + Self::AGetShort(ins) => ins.max_ins_size(), + Self::APut(ins) => ins.max_ins_size(), + Self::APutWide(ins) => ins.max_ins_size(), + Self::APutObject(ins) => ins.max_ins_size(), + Self::APutBoolean(ins) => ins.max_ins_size(), + Self::APutByte(ins) => ins.max_ins_size(), + Self::APutChar(ins) => ins.max_ins_size(), + Self::APutShort(ins) => ins.max_ins_size(), + Self::IGet(ins) => ins.max_ins_size(), + Self::IGetWide(ins) => ins.max_ins_size(), + Self::IGetObject(ins) => ins.max_ins_size(), + Self::IGetBoolean(ins) => ins.max_ins_size(), + Self::IGetByte(ins) => ins.max_ins_size(), + Self::IGetChar(ins) => ins.max_ins_size(), + Self::IGetShort(ins) => ins.max_ins_size(), + Self::IPut(ins) => ins.max_ins_size(), + Self::IPutWide(ins) => ins.max_ins_size(), + Self::IPutObject(ins) => ins.max_ins_size(), + Self::IPutBoolean(ins) => ins.max_ins_size(), + Self::IPutByte(ins) => ins.max_ins_size(), + Self::IPutChar(ins) => ins.max_ins_size(), + Self::IPutShort(ins) => ins.max_ins_size(), + Self::SGet(ins) => ins.max_ins_size(), + Self::SGetWide(ins) => ins.max_ins_size(), + Self::SGetObject(ins) => ins.max_ins_size(), + Self::SGetBoolean(ins) => ins.max_ins_size(), + Self::SGetByte(ins) => ins.max_ins_size(), + Self::SGetChar(ins) => ins.max_ins_size(), + Self::SGetShort(ins) => ins.max_ins_size(), + Self::SPut(ins) => ins.max_ins_size(), + Self::SPutWide(ins) => ins.max_ins_size(), + Self::SPutObject(ins) => ins.max_ins_size(), + Self::SPutBoolean(ins) => ins.max_ins_size(), + Self::SPutByte(ins) => ins.max_ins_size(), + Self::SPutChar(ins) => ins.max_ins_size(), + Self::SPutShort(ins) => ins.max_ins_size(), + Self::InvokeVirtual(ins) => ins.max_ins_size(), + Self::InvokeSuper(ins) => ins.max_ins_size(), + Self::InvokeDirect(ins) => ins.max_ins_size(), + Self::InvokeStatic(ins) => ins.max_ins_size(), + Self::InvokeInterface(ins) => ins.max_ins_size(), + Self::NegInt(ins) => ins.max_ins_size(), + Self::NotInt(ins) => ins.max_ins_size(), + Self::NegLong(ins) => ins.max_ins_size(), + Self::NotLong(ins) => ins.max_ins_size(), + Self::NegFloat(ins) => ins.max_ins_size(), + Self::NegDouble(ins) => ins.max_ins_size(), + Self::IntToLong(ins) => ins.max_ins_size(), + Self::IntToFloat(ins) => ins.max_ins_size(), + Self::IntToDouble(ins) => ins.max_ins_size(), + Self::LongToInt(ins) => ins.max_ins_size(), + Self::LongToFloat(ins) => ins.max_ins_size(), + Self::LongToDouble(ins) => ins.max_ins_size(), + Self::FloatToInt(ins) => ins.max_ins_size(), + Self::FloatToLong(ins) => ins.max_ins_size(), + Self::FloatToDouble(ins) => ins.max_ins_size(), + Self::DoubleToInt(ins) => ins.max_ins_size(), + Self::DoubleToLong(ins) => ins.max_ins_size(), + Self::DoubleToFloat(ins) => ins.max_ins_size(), + Self::IntToByte(ins) => ins.max_ins_size(), + Self::IntToChar(ins) => ins.max_ins_size(), + Self::IntToShort(ins) => ins.max_ins_size(), + Self::AddInt(ins) => ins.max_ins_size(), + Self::SubInt(ins) => ins.max_ins_size(), + Self::MulInt(ins) => ins.max_ins_size(), + Self::DivInt(ins) => ins.max_ins_size(), + Self::RemInt(ins) => ins.max_ins_size(), + Self::AndInt(ins) => ins.max_ins_size(), + Self::OrInt(ins) => ins.max_ins_size(), + Self::XorInt(ins) => ins.max_ins_size(), + Self::ShlInt(ins) => ins.max_ins_size(), + Self::ShrInt(ins) => ins.max_ins_size(), + Self::UshrInt(ins) => ins.max_ins_size(), + Self::AddLong(ins) => ins.max_ins_size(), + Self::SubLong(ins) => ins.max_ins_size(), + Self::MulLong(ins) => ins.max_ins_size(), + Self::DivLong(ins) => ins.max_ins_size(), + Self::RemLong(ins) => ins.max_ins_size(), + Self::AndLong(ins) => ins.max_ins_size(), + Self::OrLong(ins) => ins.max_ins_size(), + Self::XorLong(ins) => ins.max_ins_size(), + Self::ShlLong(ins) => ins.max_ins_size(), + Self::ShrLong(ins) => ins.max_ins_size(), + Self::UshrLong(ins) => ins.max_ins_size(), + Self::AddFloat(ins) => ins.max_ins_size(), + Self::SubFloat(ins) => ins.max_ins_size(), + Self::MulFloat(ins) => ins.max_ins_size(), + Self::DivFloat(ins) => ins.max_ins_size(), + Self::RemFloat(ins) => ins.max_ins_size(), + Self::AddDouble(ins) => ins.max_ins_size(), + Self::SubDouble(ins) => ins.max_ins_size(), + Self::MulDouble(ins) => ins.max_ins_size(), + Self::DivDouble(ins) => ins.max_ins_size(), + Self::RemDouble(ins) => ins.max_ins_size(), + Self::AddInt2Addr(ins) => ins.max_ins_size(), + Self::SubInt2Addr(ins) => ins.max_ins_size(), + Self::MulInt2Addr(ins) => ins.max_ins_size(), + Self::DivInt2Addr(ins) => ins.max_ins_size(), + Self::RemInt2Addr(ins) => ins.max_ins_size(), + Self::AndInt2Addr(ins) => ins.max_ins_size(), + Self::OrInt2Addr(ins) => ins.max_ins_size(), + Self::XorInt2Addr(ins) => ins.max_ins_size(), + Self::ShlInt2Addr(ins) => ins.max_ins_size(), + Self::ShrInt2Addr(ins) => ins.max_ins_size(), + Self::UshrInt2Addr(ins) => ins.max_ins_size(), + Self::AddLong2Addr(ins) => ins.max_ins_size(), + Self::SubLong2Addr(ins) => ins.max_ins_size(), + Self::MulLong2Addr(ins) => ins.max_ins_size(), + Self::DivLong2Addr(ins) => ins.max_ins_size(), + Self::RemLong2Addr(ins) => ins.max_ins_size(), + Self::AndLong2Addr(ins) => ins.max_ins_size(), + Self::OrLong2Addr(ins) => ins.max_ins_size(), + Self::XorLong2Addr(ins) => ins.max_ins_size(), + Self::ShlLong2Addr(ins) => ins.max_ins_size(), + Self::ShrLong2Addr(ins) => ins.max_ins_size(), + Self::UshrLong2Addr(ins) => ins.max_ins_size(), + Self::AddFloat2Addr(ins) => ins.max_ins_size(), + Self::SubFloat2Addr(ins) => ins.max_ins_size(), + Self::MulFloat2Addr(ins) => ins.max_ins_size(), + Self::DivFloat2Addr(ins) => ins.max_ins_size(), + Self::RemFloat2Addr(ins) => ins.max_ins_size(), + Self::AddDouble2Addr(ins) => ins.max_ins_size(), + Self::SubDouble2Addr(ins) => ins.max_ins_size(), + Self::MulDouble2Addr(ins) => ins.max_ins_size(), + Self::DivDouble2Addr(ins) => ins.max_ins_size(), + Self::RemDouble2Addr(ins) => ins.max_ins_size(), + Self::AddIntLit(ins) => ins.max_ins_size(), + Self::RsubIntLit(ins) => ins.max_ins_size(), + Self::MulIntLit(ins) => ins.max_ins_size(), + Self::DivIntLit(ins) => ins.max_ins_size(), + Self::RemIntLit(ins) => ins.max_ins_size(), + Self::AndIntLit(ins) => ins.max_ins_size(), + Self::OrIntLit(ins) => ins.max_ins_size(), + Self::XorIntLit(ins) => ins.max_ins_size(), + Self::ShlIntLit(ins) => ins.max_ins_size(), + Self::ShrIntLit(ins) => ins.max_ins_size(), + Self::UshrIntLit(ins) => ins.max_ins_size(), + Self::InvokePolymorphic(ins) => ins.max_ins_size(), + Self::InvokeCustom(ins) => ins.max_ins_size(), + Self::ConstMethodHandle(ins) => ins.max_ins_size(), + Self::ConstMethodType(ins) => ins.max_ins_size(), + Self::Try(ins) => ins.max_ins_size(), + Self::Label(ins) => ins.max_ins_size(), + } + } + + /// Return the actual size of the instruction. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + pub fn ins_size(&self) -> Result { + match self { + Self::Nop(ins) => Ok(ins.ins_size()), + Self::Move(ins) => Ok(ins.ins_size()), + Self::MoveWide(ins) => Ok(ins.ins_size()), + Self::MoveObject(ins) => Ok(ins.ins_size()), + Self::MoveResult(ins) => Ok(ins.ins_size()), + Self::MoveResultWide(ins) => Ok(ins.ins_size()), + Self::MoveException(ins) => Ok(ins.ins_size()), + Self::MoveResultObject(ins) => Ok(ins.ins_size()), + Self::ReturnVoid(ins) => Ok(ins.ins_size()), + Self::Return(ins) => Ok(ins.ins_size()), + Self::ReturnWide(ins) => Ok(ins.ins_size()), + Self::ReturnObject(ins) => Ok(ins.ins_size()), + Self::Const(ins) => Ok(ins.ins_size()), + Self::ConstWide(ins) => Ok(ins.ins_size()), + Self::ConstString(_) => Err(anyhow!( + "Cannot get the size of a const-string size without knowing the string idx" + )), + Self::ConstClass(ins) => Ok(ins.ins_size()), + Self::MonitorEnter(ins) => Ok(ins.ins_size()), + Self::MonitorExit(ins) => Ok(ins.ins_size()), + Self::CheckCast(ins) => Ok(ins.ins_size()), + Self::InstanceOf(ins) => Ok(ins.ins_size()), + Self::ArrayLength(ins) => Ok(ins.ins_size()), + Self::NewInstance(ins) => Ok(ins.ins_size()), + Self::NewArray(ins) => Ok(ins.ins_size()), + Self::FilledNewArray(ins) => Ok(ins.ins_size()), + Self::FillArrayData(ins) => Ok(ins.ins_size()), + Self::Throw(ins) => Ok(ins.ins_size()), + Self::Goto(_) => Err(anyhow!( + "Cannot get the size of a goto without knowing the branch offset" + )), + Self::Switch(ins) => Ok(ins.ins_size()), + Self::CmpLFloat(ins) => Ok(ins.ins_size()), + Self::CmpGFloat(ins) => Ok(ins.ins_size()), + Self::CmpLDouble(ins) => Ok(ins.ins_size()), + Self::CmpGDouble(ins) => Ok(ins.ins_size()), + Self::CmpLong(ins) => Ok(ins.ins_size()), + Self::IfEq(ins) => Ok(ins.ins_size()), + Self::IfNe(ins) => Ok(ins.ins_size()), + Self::IfLt(ins) => Ok(ins.ins_size()), + Self::IfGe(ins) => Ok(ins.ins_size()), + Self::IfGt(ins) => Ok(ins.ins_size()), + Self::IfLe(ins) => Ok(ins.ins_size()), + Self::IfEqZ(ins) => Ok(ins.ins_size()), + Self::IfNeZ(ins) => Ok(ins.ins_size()), + Self::IfLtZ(ins) => Ok(ins.ins_size()), + Self::IfGeZ(ins) => Ok(ins.ins_size()), + Self::IfGtZ(ins) => Ok(ins.ins_size()), + Self::IfLeZ(ins) => Ok(ins.ins_size()), + Self::AGet(ins) => Ok(ins.ins_size()), + Self::AGetWide(ins) => Ok(ins.ins_size()), + Self::AGetObject(ins) => Ok(ins.ins_size()), + Self::AGetBoolean(ins) => Ok(ins.ins_size()), + Self::AGetByte(ins) => Ok(ins.ins_size()), + Self::AGetChar(ins) => Ok(ins.ins_size()), + Self::AGetShort(ins) => Ok(ins.ins_size()), + Self::APut(ins) => Ok(ins.ins_size()), + Self::APutWide(ins) => Ok(ins.ins_size()), + Self::APutObject(ins) => Ok(ins.ins_size()), + Self::APutBoolean(ins) => Ok(ins.ins_size()), + Self::APutByte(ins) => Ok(ins.ins_size()), + Self::APutChar(ins) => Ok(ins.ins_size()), + Self::APutShort(ins) => Ok(ins.ins_size()), + Self::IGet(ins) => Ok(ins.ins_size()), + Self::IGetWide(ins) => Ok(ins.ins_size()), + Self::IGetObject(ins) => Ok(ins.ins_size()), + Self::IGetBoolean(ins) => Ok(ins.ins_size()), + Self::IGetByte(ins) => Ok(ins.ins_size()), + Self::IGetChar(ins) => Ok(ins.ins_size()), + Self::IGetShort(ins) => Ok(ins.ins_size()), + Self::IPut(ins) => Ok(ins.ins_size()), + Self::IPutWide(ins) => Ok(ins.ins_size()), + Self::IPutObject(ins) => Ok(ins.ins_size()), + Self::IPutBoolean(ins) => Ok(ins.ins_size()), + Self::IPutByte(ins) => Ok(ins.ins_size()), + Self::IPutChar(ins) => Ok(ins.ins_size()), + Self::IPutShort(ins) => Ok(ins.ins_size()), + Self::SGet(ins) => Ok(ins.ins_size()), + Self::SGetWide(ins) => Ok(ins.ins_size()), + Self::SGetObject(ins) => Ok(ins.ins_size()), + Self::SGetBoolean(ins) => Ok(ins.ins_size()), + Self::SGetByte(ins) => Ok(ins.ins_size()), + Self::SGetChar(ins) => Ok(ins.ins_size()), + Self::SGetShort(ins) => Ok(ins.ins_size()), + Self::SPut(ins) => Ok(ins.ins_size()), + Self::SPutWide(ins) => Ok(ins.ins_size()), + Self::SPutObject(ins) => Ok(ins.ins_size()), + Self::SPutBoolean(ins) => Ok(ins.ins_size()), + Self::SPutByte(ins) => Ok(ins.ins_size()), + Self::SPutChar(ins) => Ok(ins.ins_size()), + Self::SPutShort(ins) => Ok(ins.ins_size()), + Self::InvokeVirtual(ins) => Ok(ins.ins_size()), + Self::InvokeSuper(ins) => Ok(ins.ins_size()), + Self::InvokeDirect(ins) => Ok(ins.ins_size()), + Self::InvokeStatic(ins) => Ok(ins.ins_size()), + Self::InvokeInterface(ins) => Ok(ins.ins_size()), + Self::NegInt(ins) => Ok(ins.ins_size()), + Self::NotInt(ins) => Ok(ins.ins_size()), + Self::NegLong(ins) => Ok(ins.ins_size()), + Self::NotLong(ins) => Ok(ins.ins_size()), + Self::NegFloat(ins) => Ok(ins.ins_size()), + Self::NegDouble(ins) => Ok(ins.ins_size()), + Self::IntToLong(ins) => Ok(ins.ins_size()), + Self::IntToFloat(ins) => Ok(ins.ins_size()), + Self::IntToDouble(ins) => Ok(ins.ins_size()), + Self::LongToInt(ins) => Ok(ins.ins_size()), + Self::LongToFloat(ins) => Ok(ins.ins_size()), + Self::LongToDouble(ins) => Ok(ins.ins_size()), + Self::FloatToInt(ins) => Ok(ins.ins_size()), + Self::FloatToLong(ins) => Ok(ins.ins_size()), + Self::FloatToDouble(ins) => Ok(ins.ins_size()), + Self::DoubleToInt(ins) => Ok(ins.ins_size()), + Self::DoubleToLong(ins) => Ok(ins.ins_size()), + Self::DoubleToFloat(ins) => Ok(ins.ins_size()), + Self::IntToByte(ins) => Ok(ins.ins_size()), + Self::IntToChar(ins) => Ok(ins.ins_size()), + Self::IntToShort(ins) => Ok(ins.ins_size()), + Self::AddInt(ins) => Ok(ins.ins_size()), + Self::SubInt(ins) => Ok(ins.ins_size()), + Self::MulInt(ins) => Ok(ins.ins_size()), + Self::DivInt(ins) => Ok(ins.ins_size()), + Self::RemInt(ins) => Ok(ins.ins_size()), + Self::AndInt(ins) => Ok(ins.ins_size()), + Self::OrInt(ins) => Ok(ins.ins_size()), + Self::XorInt(ins) => Ok(ins.ins_size()), + Self::ShlInt(ins) => Ok(ins.ins_size()), + Self::ShrInt(ins) => Ok(ins.ins_size()), + Self::UshrInt(ins) => Ok(ins.ins_size()), + Self::AddLong(ins) => Ok(ins.ins_size()), + Self::SubLong(ins) => Ok(ins.ins_size()), + Self::MulLong(ins) => Ok(ins.ins_size()), + Self::DivLong(ins) => Ok(ins.ins_size()), + Self::RemLong(ins) => Ok(ins.ins_size()), + Self::AndLong(ins) => Ok(ins.ins_size()), + Self::OrLong(ins) => Ok(ins.ins_size()), + Self::XorLong(ins) => Ok(ins.ins_size()), + Self::ShlLong(ins) => Ok(ins.ins_size()), + Self::ShrLong(ins) => Ok(ins.ins_size()), + Self::UshrLong(ins) => Ok(ins.ins_size()), + Self::AddFloat(ins) => Ok(ins.ins_size()), + Self::SubFloat(ins) => Ok(ins.ins_size()), + Self::MulFloat(ins) => Ok(ins.ins_size()), + Self::DivFloat(ins) => Ok(ins.ins_size()), + Self::RemFloat(ins) => Ok(ins.ins_size()), + Self::AddDouble(ins) => Ok(ins.ins_size()), + Self::SubDouble(ins) => Ok(ins.ins_size()), + Self::MulDouble(ins) => Ok(ins.ins_size()), + Self::DivDouble(ins) => Ok(ins.ins_size()), + Self::RemDouble(ins) => Ok(ins.ins_size()), + Self::AddInt2Addr(ins) => Ok(ins.ins_size()), + Self::SubInt2Addr(ins) => Ok(ins.ins_size()), + Self::MulInt2Addr(ins) => Ok(ins.ins_size()), + Self::DivInt2Addr(ins) => Ok(ins.ins_size()), + Self::RemInt2Addr(ins) => Ok(ins.ins_size()), + Self::AndInt2Addr(ins) => Ok(ins.ins_size()), + Self::OrInt2Addr(ins) => Ok(ins.ins_size()), + Self::XorInt2Addr(ins) => Ok(ins.ins_size()), + Self::ShlInt2Addr(ins) => Ok(ins.ins_size()), + Self::ShrInt2Addr(ins) => Ok(ins.ins_size()), + Self::UshrInt2Addr(ins) => Ok(ins.ins_size()), + Self::AddLong2Addr(ins) => Ok(ins.ins_size()), + Self::SubLong2Addr(ins) => Ok(ins.ins_size()), + Self::MulLong2Addr(ins) => Ok(ins.ins_size()), + Self::DivLong2Addr(ins) => Ok(ins.ins_size()), + Self::RemLong2Addr(ins) => Ok(ins.ins_size()), + Self::AndLong2Addr(ins) => Ok(ins.ins_size()), + Self::OrLong2Addr(ins) => Ok(ins.ins_size()), + Self::XorLong2Addr(ins) => Ok(ins.ins_size()), + Self::ShlLong2Addr(ins) => Ok(ins.ins_size()), + Self::ShrLong2Addr(ins) => Ok(ins.ins_size()), + Self::UshrLong2Addr(ins) => Ok(ins.ins_size()), + Self::AddFloat2Addr(ins) => Ok(ins.ins_size()), + Self::SubFloat2Addr(ins) => Ok(ins.ins_size()), + Self::MulFloat2Addr(ins) => Ok(ins.ins_size()), + Self::DivFloat2Addr(ins) => Ok(ins.ins_size()), + Self::RemFloat2Addr(ins) => Ok(ins.ins_size()), + Self::AddDouble2Addr(ins) => Ok(ins.ins_size()), + Self::SubDouble2Addr(ins) => Ok(ins.ins_size()), + Self::MulDouble2Addr(ins) => Ok(ins.ins_size()), + Self::DivDouble2Addr(ins) => Ok(ins.ins_size()), + Self::RemDouble2Addr(ins) => Ok(ins.ins_size()), + Self::AddIntLit(ins) => Ok(ins.ins_size()), + Self::RsubIntLit(ins) => Ok(ins.ins_size()), + Self::MulIntLit(ins) => Ok(ins.ins_size()), + Self::DivIntLit(ins) => Ok(ins.ins_size()), + Self::RemIntLit(ins) => Ok(ins.ins_size()), + Self::AndIntLit(ins) => Ok(ins.ins_size()), + Self::OrIntLit(ins) => Ok(ins.ins_size()), + Self::XorIntLit(ins) => Ok(ins.ins_size()), + Self::ShlIntLit(ins) => Ok(ins.ins_size()), + Self::ShrIntLit(ins) => Ok(ins.ins_size()), + Self::UshrIntLit(ins) => Ok(ins.ins_size()), + Self::InvokePolymorphic(ins) => Ok(ins.ins_size()), + Self::InvokeCustom(ins) => Ok(ins.ins_size()), + Self::ConstMethodHandle(ins) => Ok(ins.ins_size()), + Self::ConstMethodType(ins) => Ok(ins.ins_size()), + Self::Try(ins) => Ok(ins.ins_size()), + Self::Label(ins) => Ok(ins.ins_size()), + } + } + + /// Return the raw instruction ([`InsFormat`]) when it does not need additionnal data. + /// + /// # Warning + /// + /// Some instruction require additionnal data, or do not have associated instruction format. + /// This method will return an error for thos instruction. + /// + /// This method should be used in a match statetement in the default branch, for brevity. + /// + /// # Variants that do not implement this method: + /// + /// - `ConstString` + /// - `ConstClass` + /// - `CheckCast` + /// - `InstanceOf` + /// - `NewInstance` + /// - `NewArray` + /// - `FilledNewArray` + /// - `FillArrayData` + /// - `Goto` + /// - `Switch` + /// - `IfEq` + /// - `IfNe` + /// - `IfLt` + /// - `IfGe` + /// - `IfGt` + /// - `IfLe` + /// - `IfEqZ` + /// - `IfNeZ` + /// - `IfLtZ` + /// - `IfGeZ` + /// - `IfGtZ` + /// - `IfLeZ` + /// - `IGet` + /// - `IGetWide` + /// - `IGetObject` + /// - `IGetBoolean` + /// - `IGetByte` + /// - `IGetChar` + /// - `IGetShort` + /// - `IPut` + /// - `IPutWide` + /// - `IPutObject` + /// - `IPutBoolean` + /// - `IPutByte` + /// - `IPutChar` + /// - `IPutShort` + /// - `SGet` + /// - `SGetWide` + /// - `SGetObject` + /// - `SGetBoolean` + /// - `SGetByte` + /// - `SGetChar` + /// - `SGetShort` + /// - `SPut` + /// - `SPutWide` + /// - `SPutObject` + /// - `SPutBoolean` + /// - `SPutByte` + /// - `SPutChar` + /// - `SPutShort` + /// - `InvokeVirtual` + /// - `InvokeSuper` + /// - `InvokeDirect` + /// - `InvokeStatic` + /// - `InvokeInterface` + /// - `InvokePolymorphic` + /// - `InvokeCustom` + /// - `ConstMethodHandle` + /// - `ConstMethodType` + /// - `Try` + /// - `Label` + pub fn get_raw_ins(&self) -> Result { + match self { + Self::Nop(ins) => Ok(ins.get_raw_ins()), + Self::Move(ins) => Ok(ins.get_raw_ins()), + Self::MoveWide(ins) => Ok(ins.get_raw_ins()), + Self::MoveObject(ins) => Ok(ins.get_raw_ins()), + Self::MoveResult(ins) => Ok(ins.get_raw_ins()), + Self::MoveResultWide(ins) => Ok(ins.get_raw_ins()), + Self::MoveException(ins) => Ok(ins.get_raw_ins()), + Self::MoveResultObject(ins) => Ok(ins.get_raw_ins()), + Self::ReturnVoid(ins) => Ok(ins.get_raw_ins()), + Self::Return(ins) => Ok(ins.get_raw_ins()), + Self::ReturnWide(ins) => Ok(ins.get_raw_ins()), + Self::ReturnObject(ins) => Ok(ins.get_raw_ins()), + Self::Const(ins) => Ok(ins.get_raw_ins()), + Self::ConstWide(ins) => Ok(ins.get_raw_ins()), + Self::ConstString(_) => Err(anyhow!( + "Cannot get the raw instruction of a const-string without knowing the string idx" + )), + Self::ConstClass(_) => Err(anyhow!( + "Cannot get the raw instruction of a const-class without knowing the class idx" + )), + Self::MonitorEnter(ins) => Ok(ins.get_raw_ins()), + Self::MonitorExit(ins) => Ok(ins.get_raw_ins()), + Self::CheckCast(_) => Err(anyhow!( + "Cannot get the raw instruction of a check-cast without knowing the type idx" + )), + Self::InstanceOf(_) => Err(anyhow!( + "Cannot get the raw instruction of a instance-of without knowing the type idx" + )), + Self::ArrayLength(ins) => Ok(ins.get_raw_ins()), + Self::NewInstance(_) => Err(anyhow!( + "Cannot get the raw instruction of a new-instance without knowing the class idx" + )), + Self::NewArray(_) => Err(anyhow!( + "Cannot get the raw instruction of a new-array without knowing the type idx" + )), + Self::FilledNewArray(_) => Err(anyhow!( + "Cannot get the raw instruction of a filled-new-array without knowing the type idx" + )), + Self::FillArrayData(_) => Err(anyhow!( + "Cannot get the raw instruction of a fill-array-data without knowing the offset \ + to the -fill-array-data-payload" + )), + Self::Throw(ins) => Ok(ins.get_raw_ins()), + Self::Goto(_) => Err(anyhow!( + "Cannot get the size of a goto without knowing the branch offset" + )), + Self::Switch(_) => Err(anyhow!( + "Cannot get the raw instruction of a switch without knowing the offset \ + to the packed/sparse-switch-payload" + )), + Self::CmpLFloat(ins) => Ok(ins.get_raw_ins()), + Self::CmpGFloat(ins) => Ok(ins.get_raw_ins()), + Self::CmpLDouble(ins) => Ok(ins.get_raw_ins()), + Self::CmpGDouble(ins) => Ok(ins.get_raw_ins()), + Self::CmpLong(ins) => Ok(ins.get_raw_ins()), + Self::IfEq(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-eq without knowing \ + the offset to the branch" + )), + Self::IfNe(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-ne without knowing \ + the offset to the branch" + )), + Self::IfLt(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-lt without knowing \ + the offset to the branch" + )), + Self::IfGe(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-ge without knowing \ + the offset to the branch" + )), + Self::IfGt(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-gt without knowing \ + the offset to the branch" + )), + Self::IfLe(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-le without knowing \ + the offset to the branch" + )), + Self::IfEqZ(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-eqz without knowing \ + the offset to the branch" + )), + Self::IfNeZ(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-nez without knowing \ + the offset to the branch" + )), + Self::IfLtZ(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-ltz without knowing \ + the offset to the branch" + )), + Self::IfGeZ(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-gez without knowing \ + the offset to the branch" + )), + Self::IfGtZ(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-gtz without knowing \ + the offset to the branch" + )), + Self::IfLeZ(_) => Err(anyhow!( + "Cannot get the raw instruction of a if-lez without knowing \ + the offset to the branch" + )), + Self::AGet(ins) => Ok(ins.get_raw_ins()), + Self::AGetWide(ins) => Ok(ins.get_raw_ins()), + Self::AGetObject(ins) => Ok(ins.get_raw_ins()), + Self::AGetBoolean(ins) => Ok(ins.get_raw_ins()), + Self::AGetByte(ins) => Ok(ins.get_raw_ins()), + Self::AGetChar(ins) => Ok(ins.get_raw_ins()), + Self::AGetShort(ins) => Ok(ins.get_raw_ins()), + Self::APut(ins) => Ok(ins.get_raw_ins()), + Self::APutWide(ins) => Ok(ins.get_raw_ins()), + Self::APutObject(ins) => Ok(ins.get_raw_ins()), + Self::APutBoolean(ins) => Ok(ins.get_raw_ins()), + Self::APutByte(ins) => Ok(ins.get_raw_ins()), + Self::APutChar(ins) => Ok(ins.get_raw_ins()), + Self::APutShort(ins) => Ok(ins.get_raw_ins()), + Self::IGet(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget without knowing the field idx" + )), + Self::IGetWide(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget-wide without knowing the field idx" + )), + Self::IGetObject(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget-object without knowing the field idx" + )), + Self::IGetBoolean(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget-boolean without knowing the field idx" + )), + Self::IGetByte(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget-byte without knowing the field idx" + )), + Self::IGetChar(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget-char without knowing the field idx" + )), + Self::IGetShort(_) => Err(anyhow!( + "Cannot get the raw instruction of a iget-short without knowing the field idx" + )), + Self::IPut(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput without knowing the field idx" + )), + Self::IPutWide(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput-wide without knowing the field idx" + )), + Self::IPutObject(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput-object without knowing the field idx" + )), + Self::IPutBoolean(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput-boolean without knowing the field idx" + )), + Self::IPutByte(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput-byte without knowing the field idx" + )), + Self::IPutChar(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput-char without knowing the field idx" + )), + Self::IPutShort(_) => Err(anyhow!( + "Cannot get the raw instruction of a iput-short without knowing the field idx" + )), + Self::SGet(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget without knowing the field idx" + )), + Self::SGetWide(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget-wide without knowing the field idx" + )), + Self::SGetObject(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget-object without knowing the field idx" + )), + Self::SGetBoolean(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget-boolean without knowing the field idx" + )), + Self::SGetByte(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget-byte without knowing the field idx" + )), + Self::SGetChar(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget-char without knowing the field idx" + )), + Self::SGetShort(_) => Err(anyhow!( + "Cannot get the raw instruction of a sget-short without knowing the field idx" + )), + Self::SPut(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput without knowing the field idx" + )), + Self::SPutWide(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput-wide without knowing the field idx" + )), + Self::SPutObject(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput-object without knowing the field idx" + )), + Self::SPutBoolean(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput-boolean without knowing the field idx" + )), + Self::SPutByte(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput-byte without knowing the field idx" + )), + Self::SPutChar(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput-char without knowing the field idx" + )), + Self::SPutShort(_) => Err(anyhow!( + "Cannot get the raw instruction of a sput-short without knowing the field idx" + )), + Self::InvokeVirtual(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-virtual without knowing \ + the method idx" + )), + Self::InvokeSuper(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-super without knowing \ + the method idx" + )), + Self::InvokeDirect(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-direct without knowing \ + the method idx" + )), + Self::InvokeStatic(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-static without knowing \ + the method idx" + )), + Self::InvokeInterface(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-interface without knowing \ + the method idx" + )), + Self::NegInt(ins) => Ok(ins.get_raw_ins()), + Self::NotInt(ins) => Ok(ins.get_raw_ins()), + Self::NegLong(ins) => Ok(ins.get_raw_ins()), + Self::NotLong(ins) => Ok(ins.get_raw_ins()), + Self::NegFloat(ins) => Ok(ins.get_raw_ins()), + Self::NegDouble(ins) => Ok(ins.get_raw_ins()), + Self::IntToLong(ins) => Ok(ins.get_raw_ins()), + Self::IntToFloat(ins) => Ok(ins.get_raw_ins()), + Self::IntToDouble(ins) => Ok(ins.get_raw_ins()), + Self::LongToInt(ins) => Ok(ins.get_raw_ins()), + Self::LongToFloat(ins) => Ok(ins.get_raw_ins()), + Self::LongToDouble(ins) => Ok(ins.get_raw_ins()), + Self::FloatToInt(ins) => Ok(ins.get_raw_ins()), + Self::FloatToLong(ins) => Ok(ins.get_raw_ins()), + Self::FloatToDouble(ins) => Ok(ins.get_raw_ins()), + Self::DoubleToInt(ins) => Ok(ins.get_raw_ins()), + Self::DoubleToLong(ins) => Ok(ins.get_raw_ins()), + Self::DoubleToFloat(ins) => Ok(ins.get_raw_ins()), + Self::IntToByte(ins) => Ok(ins.get_raw_ins()), + Self::IntToChar(ins) => Ok(ins.get_raw_ins()), + Self::IntToShort(ins) => Ok(ins.get_raw_ins()), + Self::AddInt(ins) => Ok(ins.get_raw_ins()), + Self::SubInt(ins) => Ok(ins.get_raw_ins()), + Self::MulInt(ins) => Ok(ins.get_raw_ins()), + Self::DivInt(ins) => Ok(ins.get_raw_ins()), + Self::RemInt(ins) => Ok(ins.get_raw_ins()), + Self::AndInt(ins) => Ok(ins.get_raw_ins()), + Self::OrInt(ins) => Ok(ins.get_raw_ins()), + Self::XorInt(ins) => Ok(ins.get_raw_ins()), + Self::ShlInt(ins) => Ok(ins.get_raw_ins()), + Self::ShrInt(ins) => Ok(ins.get_raw_ins()), + Self::UshrInt(ins) => Ok(ins.get_raw_ins()), + Self::AddLong(ins) => Ok(ins.get_raw_ins()), + Self::SubLong(ins) => Ok(ins.get_raw_ins()), + Self::MulLong(ins) => Ok(ins.get_raw_ins()), + Self::DivLong(ins) => Ok(ins.get_raw_ins()), + Self::RemLong(ins) => Ok(ins.get_raw_ins()), + Self::AndLong(ins) => Ok(ins.get_raw_ins()), + Self::OrLong(ins) => Ok(ins.get_raw_ins()), + Self::XorLong(ins) => Ok(ins.get_raw_ins()), + Self::ShlLong(ins) => Ok(ins.get_raw_ins()), + Self::ShrLong(ins) => Ok(ins.get_raw_ins()), + Self::UshrLong(ins) => Ok(ins.get_raw_ins()), + Self::AddFloat(ins) => Ok(ins.get_raw_ins()), + Self::SubFloat(ins) => Ok(ins.get_raw_ins()), + Self::MulFloat(ins) => Ok(ins.get_raw_ins()), + Self::DivFloat(ins) => Ok(ins.get_raw_ins()), + Self::RemFloat(ins) => Ok(ins.get_raw_ins()), + Self::AddDouble(ins) => Ok(ins.get_raw_ins()), + Self::SubDouble(ins) => Ok(ins.get_raw_ins()), + Self::MulDouble(ins) => Ok(ins.get_raw_ins()), + Self::DivDouble(ins) => Ok(ins.get_raw_ins()), + Self::RemDouble(ins) => Ok(ins.get_raw_ins()), + Self::AddInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::SubInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::MulInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::DivInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::RemInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::AndInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::OrInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::XorInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::ShlInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::ShrInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::UshrInt2Addr(ins) => Ok(ins.get_raw_ins()), + Self::AddLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::SubLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::MulLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::DivLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::RemLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::AndLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::OrLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::XorLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::ShlLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::ShrLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::UshrLong2Addr(ins) => Ok(ins.get_raw_ins()), + Self::AddFloat2Addr(ins) => Ok(ins.get_raw_ins()), + Self::SubFloat2Addr(ins) => Ok(ins.get_raw_ins()), + Self::MulFloat2Addr(ins) => Ok(ins.get_raw_ins()), + Self::DivFloat2Addr(ins) => Ok(ins.get_raw_ins()), + Self::RemFloat2Addr(ins) => Ok(ins.get_raw_ins()), + Self::AddDouble2Addr(ins) => Ok(ins.get_raw_ins()), + Self::SubDouble2Addr(ins) => Ok(ins.get_raw_ins()), + Self::MulDouble2Addr(ins) => Ok(ins.get_raw_ins()), + Self::DivDouble2Addr(ins) => Ok(ins.get_raw_ins()), + Self::RemDouble2Addr(ins) => Ok(ins.get_raw_ins()), + Self::AddIntLit(ins) => Ok(ins.get_raw_ins()), + Self::RsubIntLit(ins) => Ok(ins.get_raw_ins()), + Self::MulIntLit(ins) => Ok(ins.get_raw_ins()), + Self::DivIntLit(ins) => Ok(ins.get_raw_ins()), + Self::RemIntLit(ins) => Ok(ins.get_raw_ins()), + Self::AndIntLit(ins) => Ok(ins.get_raw_ins()), + Self::OrIntLit(ins) => Ok(ins.get_raw_ins()), + Self::XorIntLit(ins) => Ok(ins.get_raw_ins()), + Self::ShlIntLit(ins) => Ok(ins.get_raw_ins()), + Self::ShrIntLit(ins) => Ok(ins.get_raw_ins()), + Self::UshrIntLit(ins) => Ok(ins.get_raw_ins()), + Self::InvokePolymorphic(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-polymorphic without knowing \ + the method idx and proto idx" + )), + Self::InvokeCustom(_) => Err(anyhow!( + "Cannot get the raw instruction of a invoke-custom without knowing the \ + call site idx" + )), + Self::ConstMethodHandle(_) => Err(anyhow!( + "Cannot get the raw instruction of a const-method-handle \ + without knowing the method handle idx" + )), + Self::ConstMethodType(_) => Err(anyhow!( + "Cannot get the raw instruction of a const-method-type \ + without knowing the proto idx" + )), + Self::Try(_) => Err(anyhow!( + "Try instruction cannot be converted to raw instruction" + )), + Self::Label(_) => Err(anyhow!("Label cannot be convertedto raw instruction")), + } + } } impl<'source> FromPyObject<'source> for Instruction { @@ -1241,7 +2277,7 @@ impl CallSite { type_: IdMethodType, args: Vec, ) -> Self { - let args = args.iter().cloned().collect(); + let args = args.to_vec(); Self { method_handle, name, @@ -1288,6 +2324,12 @@ impl CallSite { #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct Nop; +impl Default for Nop { + fn default() -> Self { + Self::new() + } +} + #[pymethods] impl Nop { #[new] @@ -1311,7 +2353,7 @@ impl Nop { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1322,7 +2364,7 @@ impl Nop { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1332,7 +2374,7 @@ impl Nop { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1382,7 +2424,7 @@ impl Move { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1393,7 +2435,7 @@ impl Move { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1403,7 +2445,7 @@ impl Move { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1468,7 +2510,7 @@ impl MoveWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1479,7 +2521,7 @@ impl MoveWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1489,7 +2531,7 @@ impl MoveWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1553,7 +2595,7 @@ impl MoveObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1564,7 +2606,7 @@ impl MoveObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1574,7 +2616,7 @@ impl MoveObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1630,7 +2672,7 @@ impl MoveResult { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1641,7 +2683,7 @@ impl MoveResult { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1651,7 +2693,7 @@ impl MoveResult { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1694,7 +2736,7 @@ impl MoveResultWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1705,7 +2747,7 @@ impl MoveResultWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1715,7 +2757,7 @@ impl MoveResultWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1758,7 +2800,7 @@ impl MoveResultObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1769,7 +2811,7 @@ impl MoveResultObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1779,7 +2821,7 @@ impl MoveResultObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1823,7 +2865,7 @@ impl MoveException { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1834,7 +2876,7 @@ impl MoveException { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1844,7 +2886,7 @@ impl MoveException { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1863,6 +2905,12 @@ impl MoveException { #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct ReturnVoid; +impl Default for ReturnVoid { + fn default() -> Self { + Self::new() + } +} + #[pymethods] impl ReturnVoid { #[new] @@ -1885,7 +2933,7 @@ impl ReturnVoid { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1896,7 +2944,7 @@ impl ReturnVoid { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1906,7 +2954,7 @@ impl ReturnVoid { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -1946,7 +2994,7 @@ impl Return { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -1957,7 +3005,7 @@ impl Return { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -1967,7 +3015,7 @@ impl Return { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2010,7 +3058,7 @@ impl ReturnWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2021,7 +3069,7 @@ impl ReturnWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2031,7 +3079,7 @@ impl ReturnWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2074,7 +3122,7 @@ impl ReturnObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2085,7 +3133,7 @@ impl ReturnObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2095,7 +3143,7 @@ impl ReturnObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2148,7 +3196,7 @@ impl Const { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2159,7 +3207,7 @@ impl Const { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2169,7 +3217,7 @@ impl Const { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2240,7 +3288,7 @@ impl ConstWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2251,7 +3299,7 @@ impl ConstWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2261,7 +3309,7 @@ impl ConstWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2401,7 +3449,7 @@ impl ConstClass { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2412,7 +3460,7 @@ impl ConstClass { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2422,7 +3470,7 @@ impl ConstClass { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -2467,7 +3515,7 @@ impl MonitorEnter { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2478,7 +3526,7 @@ impl MonitorEnter { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2488,7 +3536,7 @@ impl MonitorEnter { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2532,7 +3580,7 @@ impl MonitorExit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2543,7 +3591,7 @@ impl MonitorExit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2553,7 +3601,7 @@ impl MonitorExit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2603,7 +3651,7 @@ impl CheckCast { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2614,7 +3662,7 @@ impl CheckCast { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2624,7 +3672,7 @@ impl CheckCast { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -2699,7 +3747,7 @@ impl InstanceOf { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2710,7 +3758,7 @@ impl InstanceOf { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2720,7 +3768,7 @@ impl InstanceOf { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -2786,7 +3834,7 @@ impl ArrayLength { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2797,7 +3845,7 @@ impl ArrayLength { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2807,7 +3855,7 @@ impl ArrayLength { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -2857,7 +3905,7 @@ impl NewInstance { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2868,7 +3916,7 @@ impl NewInstance { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2878,7 +3926,7 @@ impl NewInstance { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -2953,7 +4001,7 @@ impl NewArray { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -2964,7 +4012,7 @@ impl NewArray { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -2974,7 +4022,7 @@ impl NewArray { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -3022,7 +4070,7 @@ impl FilledNewArray { let mut consec = true; let mut four_bites = true; let len = self.reg_values.len(); - for r in self.reg_values { + for r in self.reg_values.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -3033,9 +4081,7 @@ impl FilledNewArray { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -3091,7 +4137,7 @@ impl FilledNewArray { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3102,7 +4148,7 @@ impl FilledNewArray { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3112,7 +4158,7 @@ impl FilledNewArray { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -3125,7 +4171,7 @@ impl FilledNewArray { let mut consec = true; let mut four_bites = true; let len = self.reg_values.len(); - for r in self.reg_values { + for r in self.reg_values.iter().cloned() { if first.is_none() { first = Some(r); } @@ -3141,7 +4187,7 @@ impl FilledNewArray { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.reg_values { + for reg in self.reg_values.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -3265,7 +4311,7 @@ impl FillArrayData { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3276,7 +4322,7 @@ impl FillArrayData { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3286,7 +4332,7 @@ impl FillArrayData { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -3332,7 +4378,7 @@ impl Throw { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3343,7 +4389,7 @@ impl Throw { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3353,7 +4399,7 @@ impl Throw { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -3423,13 +4469,12 @@ impl Goto { /// - `4`: offset must fit in an i16 /// - `6`: offset must fit in an i32 pub fn get_raw_ins(&self, data_offset: i32, goto_size: usize) -> InsFormat { - if goto_size == 2 && (I8_MIN_AS_I32 <= data_offset && data_offset <= I8_MAX_AS_I32) { + if goto_size == 2 && (I8_MIN_AS_I32..=I8_MAX_AS_I32).contains(&data_offset) { InsFormat::Format10T { op: 0x28, a: data_offset as i8, } - } else if goto_size == 4 && (I16_MIN_AS_I32 <= data_offset && data_offset <= I16_MAX_AS_I32) - { + } else if goto_size == 4 && (I16_MIN_AS_I32..=I16_MAX_AS_I32).contains(&data_offset) { InsFormat::Format20T { op: 0x29, a: data_offset as i16, @@ -3443,6 +4488,36 @@ impl Goto { panic!("Invalid goto_size and/or data_offset value") } } + + /// Return the size of a goto instruction from the goto instruction address and + /// and interval for the branch address. The size will be selected to be the smallest + /// possible size that fit the offset for the worst case scenario. + /// + /// # Warning + /// + /// The returned size is the size in bytes (`u8`) (the same as the value return + /// by the `Serializable::size()` method), but instructions in the bytecode + /// count addresses by unit of `u16`. + /// + /// The address for the intervals are in code address units `u16`. + pub fn size_from_branch_offset_interval( + addr_goto: usize, + min_addr_branch: usize, + max_addr_branch: usize, + ) -> Result { + let worst_offset = if max_addr_branch as i32 - addr_goto as i32 + > addr_goto as i32 - min_addr_branch as i32 + { + max_addr_branch as i32 - addr_goto as i32 + } else { + min_addr_branch as i32 - addr_goto as i32 + }; + match worst_offset { + I8_MIN_AS_I32..=I8_MAX_AS_I32 => Ok(2), + I16_MIN_AS_I32..=I16_MAX_AS_I32 => Ok(4), + _ => Ok(6), + } + } } /// Jump to a label depending on the value of a register. If the value @@ -3464,7 +4539,7 @@ impl Switch { pub fn __str__(&self) -> String { let mut branches_str: String = "".into(); let mut branches: Vec<_> = self.branches.iter().collect(); - branches.sort_by_key(|(key, _)| key); + branches.sort_by_key(|(key, _)| **key); for (key, label) in branches { branches_str += &format!("\n {key}: goto {label}"); } @@ -3475,14 +4550,14 @@ impl Switch { format!("Instruction(Switch({}, ...))", self.reg) } - /// Test if the swith is sparse of pack - pub fn is_sparse(&self) -> bool { + /// Test if the swith is packed of pack + pub fn is_packed(&self) -> bool { let mut last = None; let mut keys = self.branches.keys().collect::>(); keys.sort(); for key in keys.into_iter().cloned() { - if let Some(last) = last.clone() { - if last != key - 1 { + if let Some(last) = &last { + if *last != key - 1 { return false; } } @@ -3498,7 +4573,7 @@ impl Switch { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3509,7 +4584,7 @@ impl Switch { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3519,7 +4594,7 @@ impl Switch { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -3529,7 +4604,7 @@ impl Switch { /// `table_offset` is the offset to the address where the branche table located. pub fn get_raw_ins(&self, data_offset: i32) -> InsFormat { InsFormat::Format31T { - op: if self.is_sparse() { 0x2b } else { 0x2c }, + op: if self.is_packed() { 0x2b } else { 0x2c }, va: self.reg, b: data_offset, } @@ -3574,7 +4649,7 @@ impl CmpLFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3585,7 +4660,7 @@ impl CmpLFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3595,7 +4670,7 @@ impl CmpLFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -3651,7 +4726,7 @@ impl CmpGFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3662,7 +4737,7 @@ impl CmpGFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3672,7 +4747,7 @@ impl CmpGFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -3728,7 +4803,7 @@ impl CmpLDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3739,7 +4814,7 @@ impl CmpLDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3749,7 +4824,7 @@ impl CmpLDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -3805,7 +4880,7 @@ impl CmpGDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3816,7 +4891,7 @@ impl CmpGDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3826,7 +4901,7 @@ impl CmpGDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -3881,7 +4956,7 @@ impl CmpLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3892,7 +4967,7 @@ impl CmpLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3902,7 +4977,7 @@ impl CmpLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -3968,7 +5043,7 @@ impl IfEq { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -3979,7 +5054,7 @@ impl IfEq { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -3989,7 +5064,7 @@ impl IfEq { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4057,7 +5132,7 @@ impl IfNe { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4068,7 +5143,7 @@ impl IfNe { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4078,7 +5153,7 @@ impl IfNe { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4146,7 +5221,7 @@ impl IfLt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4157,7 +5232,7 @@ impl IfLt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4167,7 +5242,7 @@ impl IfLt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4235,7 +5310,7 @@ impl IfGe { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4246,7 +5321,7 @@ impl IfGe { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4256,7 +5331,7 @@ impl IfGe { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4324,7 +5399,7 @@ impl IfGt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4335,7 +5410,7 @@ impl IfGt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4345,7 +5420,7 @@ impl IfGt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4413,7 +5488,7 @@ impl IfLe { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4424,7 +5499,7 @@ impl IfLe { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4434,7 +5509,7 @@ impl IfLe { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4497,7 +5572,7 @@ impl IfEqZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4508,7 +5583,7 @@ impl IfEqZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4518,7 +5593,7 @@ impl IfEqZ { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4580,7 +5655,7 @@ impl IfNeZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4591,7 +5666,7 @@ impl IfNeZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4601,7 +5676,7 @@ impl IfNeZ { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4663,7 +5738,7 @@ impl IfLtZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4674,7 +5749,7 @@ impl IfLtZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4684,7 +5759,7 @@ impl IfLtZ { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4746,7 +5821,7 @@ impl IfGeZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4757,7 +5832,7 @@ impl IfGeZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4767,7 +5842,7 @@ impl IfGeZ { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4829,7 +5904,7 @@ impl IfGtZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4840,7 +5915,7 @@ impl IfGtZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4850,7 +5925,7 @@ impl IfGtZ { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4912,7 +5987,7 @@ impl IfLeZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4923,7 +5998,7 @@ impl IfLeZ { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -4933,7 +6008,7 @@ impl IfLeZ { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -4986,7 +6061,7 @@ impl AGet { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -4997,7 +6072,7 @@ impl AGet { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5007,7 +6082,7 @@ impl AGet { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5058,7 +6133,7 @@ impl AGetWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5069,7 +6144,7 @@ impl AGetWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5079,7 +6154,7 @@ impl AGetWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5130,7 +6205,7 @@ impl AGetObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5141,7 +6216,7 @@ impl AGetObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5151,7 +6226,7 @@ impl AGetObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5202,7 +6277,7 @@ impl AGetBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5213,7 +6288,7 @@ impl AGetBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5223,7 +6298,7 @@ impl AGetBoolean { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5274,7 +6349,7 @@ impl AGetByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5285,7 +6360,7 @@ impl AGetByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5295,7 +6370,7 @@ impl AGetByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5346,7 +6421,7 @@ impl AGetChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5357,7 +6432,7 @@ impl AGetChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5367,7 +6442,7 @@ impl AGetChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5418,7 +6493,7 @@ impl AGetShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5429,7 +6504,7 @@ impl AGetShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5439,7 +6514,7 @@ impl AGetShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5490,7 +6565,7 @@ impl APut { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5501,7 +6576,7 @@ impl APut { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5511,7 +6586,7 @@ impl APut { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5562,7 +6637,7 @@ impl APutWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5573,7 +6648,7 @@ impl APutWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5583,7 +6658,7 @@ impl APutWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5634,7 +6709,7 @@ impl APutObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5645,7 +6720,7 @@ impl APutObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5655,7 +6730,7 @@ impl APutObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5706,7 +6781,7 @@ impl APutBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5717,7 +6792,7 @@ impl APutBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5727,7 +6802,7 @@ impl APutBoolean { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5778,7 +6853,7 @@ impl APutByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5789,7 +6864,7 @@ impl APutByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5799,7 +6874,7 @@ impl APutByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5850,7 +6925,7 @@ impl APutChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5861,7 +6936,7 @@ impl APutChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5871,7 +6946,7 @@ impl APutChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -5922,7 +6997,7 @@ impl APutShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -5933,7 +7008,7 @@ impl APutShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -5943,7 +7018,7 @@ impl APutShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -6016,7 +7091,7 @@ impl IGet { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6027,7 +7102,7 @@ impl IGet { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6037,7 +7112,7 @@ impl IGet { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6118,7 +7193,7 @@ impl IGetWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6129,7 +7204,7 @@ impl IGetWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6139,7 +7214,7 @@ impl IGetWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6219,7 +7294,7 @@ impl IGetObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6230,7 +7305,7 @@ impl IGetObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6240,7 +7315,7 @@ impl IGetObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6320,7 +7395,7 @@ impl IGetBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6331,7 +7406,7 @@ impl IGetBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6341,7 +7416,7 @@ impl IGetBoolean { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6421,7 +7496,7 @@ impl IGetByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6432,7 +7507,7 @@ impl IGetByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6442,7 +7517,7 @@ impl IGetByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6522,7 +7597,7 @@ impl IGetChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6533,7 +7608,7 @@ impl IGetChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6543,7 +7618,7 @@ impl IGetChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6623,7 +7698,7 @@ impl IGetShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6634,7 +7709,7 @@ impl IGetShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6644,7 +7719,7 @@ impl IGetShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6719,7 +7794,7 @@ impl IPut { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6730,7 +7805,7 @@ impl IPut { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6740,7 +7815,7 @@ impl IPut { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6821,7 +7896,7 @@ impl IPutWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6832,7 +7907,7 @@ impl IPutWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6842,7 +7917,7 @@ impl IPutWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -6922,7 +7997,7 @@ impl IPutObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -6933,7 +8008,7 @@ impl IPutObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -6943,7 +8018,7 @@ impl IPutObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7023,7 +8098,7 @@ impl IPutBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7034,7 +8109,7 @@ impl IPutBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7044,7 +8119,7 @@ impl IPutBoolean { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7124,7 +8199,7 @@ impl IPutByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7135,7 +8210,7 @@ impl IPutByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7145,7 +8220,7 @@ impl IPutByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7225,7 +8300,7 @@ impl IPutChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7236,7 +8311,7 @@ impl IPutChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7246,7 +8321,7 @@ impl IPutChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7326,7 +8401,7 @@ impl IPutShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7337,7 +8412,7 @@ impl IPutShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7347,7 +8422,7 @@ impl IPutShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7396,7 +8471,7 @@ impl SGet { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7407,7 +8482,7 @@ impl SGet { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7417,7 +8492,7 @@ impl SGet { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7469,7 +8544,7 @@ impl SGetWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7480,7 +8555,7 @@ impl SGetWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7490,7 +8565,7 @@ impl SGetWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7542,7 +8617,7 @@ impl SGetObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7553,7 +8628,7 @@ impl SGetObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7563,7 +8638,7 @@ impl SGetObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7615,7 +8690,7 @@ impl SGetBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7626,7 +8701,7 @@ impl SGetBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7636,7 +8711,7 @@ impl SGetBoolean { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7688,7 +8763,7 @@ impl SGetByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7699,7 +8774,7 @@ impl SGetByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7709,7 +8784,7 @@ impl SGetByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7761,7 +8836,7 @@ impl SGetChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7772,7 +8847,7 @@ impl SGetChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7782,7 +8857,7 @@ impl SGetChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7834,7 +8909,7 @@ impl SGetShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7845,7 +8920,7 @@ impl SGetShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7855,7 +8930,7 @@ impl SGetShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7907,7 +8982,7 @@ impl SPut { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7918,7 +8993,7 @@ impl SPut { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -7928,7 +9003,7 @@ impl SPut { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -7981,7 +9056,7 @@ impl SPutWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -7992,7 +9067,7 @@ impl SPutWide { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8002,7 +9077,7 @@ impl SPutWide { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -8054,7 +9129,7 @@ impl SPutObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8065,7 +9140,7 @@ impl SPutObject { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8075,7 +9150,7 @@ impl SPutObject { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -8127,7 +9202,7 @@ impl SPutBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8138,7 +9213,7 @@ impl SPutBoolean { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8148,7 +9223,7 @@ impl SPutBoolean { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -8200,7 +9275,7 @@ impl SPutByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8211,7 +9286,7 @@ impl SPutByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8221,7 +9296,7 @@ impl SPutByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -8273,7 +9348,7 @@ impl SPutChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8284,7 +9359,7 @@ impl SPutChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8294,7 +9369,7 @@ impl SPutChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -8346,7 +9421,7 @@ impl SPutShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8357,7 +9432,7 @@ impl SPutShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8367,7 +9442,7 @@ impl SPutShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -8407,7 +9482,7 @@ impl InvokeVirtual { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -8418,9 +9493,7 @@ impl InvokeVirtual { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -8468,7 +9541,7 @@ impl InvokeVirtual { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8479,7 +9552,7 @@ impl InvokeVirtual { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8489,7 +9562,7 @@ impl InvokeVirtual { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -8504,7 +9577,7 @@ impl InvokeVirtual { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -8520,7 +9593,7 @@ impl InvokeVirtual { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -8582,7 +9655,7 @@ impl InvokeSuper { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -8593,9 +9666,7 @@ impl InvokeSuper { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -8643,7 +9714,7 @@ impl InvokeSuper { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8654,7 +9725,7 @@ impl InvokeSuper { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8664,7 +9735,7 @@ impl InvokeSuper { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -8679,7 +9750,7 @@ impl InvokeSuper { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -8695,7 +9766,7 @@ impl InvokeSuper { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -8757,7 +9828,7 @@ impl InvokeDirect { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -8768,9 +9839,7 @@ impl InvokeDirect { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -8818,7 +9887,7 @@ impl InvokeDirect { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -8829,7 +9898,7 @@ impl InvokeDirect { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -8839,7 +9908,7 @@ impl InvokeDirect { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -8854,7 +9923,7 @@ impl InvokeDirect { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -8870,7 +9939,7 @@ impl InvokeDirect { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -8932,7 +10001,7 @@ impl InvokeStatic { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -8943,9 +10012,7 @@ impl InvokeStatic { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -8993,7 +10060,7 @@ impl InvokeStatic { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9004,7 +10071,7 @@ impl InvokeStatic { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9014,7 +10081,7 @@ impl InvokeStatic { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -9029,7 +10096,7 @@ impl InvokeStatic { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -9045,7 +10112,7 @@ impl InvokeStatic { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -9107,7 +10174,7 @@ impl InvokeInterface { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -9118,9 +10185,7 @@ impl InvokeInterface { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -9168,7 +10233,7 @@ impl InvokeInterface { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9179,7 +10244,7 @@ impl InvokeInterface { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9189,7 +10254,7 @@ impl InvokeInterface { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -9204,7 +10269,7 @@ impl InvokeInterface { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -9220,7 +10285,7 @@ impl InvokeInterface { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -9310,7 +10375,7 @@ impl NegInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9321,7 +10386,7 @@ impl NegInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9331,7 +10396,7 @@ impl NegInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9397,7 +10462,7 @@ impl NotInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9408,7 +10473,7 @@ impl NotInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9418,7 +10483,7 @@ impl NotInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9484,7 +10549,7 @@ impl NegLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9495,7 +10560,7 @@ impl NegLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9505,7 +10570,7 @@ impl NegLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9571,7 +10636,7 @@ impl NotLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9582,7 +10647,7 @@ impl NotLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9592,7 +10657,7 @@ impl NotLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9658,7 +10723,7 @@ impl NegFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9669,7 +10734,7 @@ impl NegFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9679,7 +10744,7 @@ impl NegFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9745,7 +10810,7 @@ impl NegDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9756,7 +10821,7 @@ impl NegDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9766,7 +10831,7 @@ impl NegDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9834,7 +10899,7 @@ impl IntToLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9845,7 +10910,7 @@ impl IntToLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9855,7 +10920,7 @@ impl IntToLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -9921,7 +10986,7 @@ impl IntToFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -9932,7 +10997,7 @@ impl IntToFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -9942,7 +11007,7 @@ impl IntToFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10010,7 +11075,7 @@ impl IntToDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10021,7 +11086,7 @@ impl IntToDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10031,7 +11096,7 @@ impl IntToDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10099,7 +11164,7 @@ impl LongToInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10110,7 +11175,7 @@ impl LongToInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10120,7 +11185,7 @@ impl LongToInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10188,7 +11253,7 @@ impl LongToFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10199,7 +11264,7 @@ impl LongToFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10209,7 +11274,7 @@ impl LongToFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10277,7 +11342,7 @@ impl LongToDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10288,7 +11353,7 @@ impl LongToDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10298,7 +11363,7 @@ impl LongToDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10364,7 +11429,7 @@ impl FloatToInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10375,7 +11440,7 @@ impl FloatToInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10385,7 +11450,7 @@ impl FloatToInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10453,7 +11518,7 @@ impl FloatToLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10464,7 +11529,7 @@ impl FloatToLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10474,7 +11539,7 @@ impl FloatToLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10542,7 +11607,7 @@ impl FloatToDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10553,7 +11618,7 @@ impl FloatToDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10563,7 +11628,7 @@ impl FloatToDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10631,7 +11696,7 @@ impl DoubleToInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10642,7 +11707,7 @@ impl DoubleToInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10652,7 +11717,7 @@ impl DoubleToInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10720,7 +11785,7 @@ impl DoubleToLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10731,7 +11796,7 @@ impl DoubleToLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10741,7 +11806,7 @@ impl DoubleToLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10809,7 +11874,7 @@ impl DoubleToFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10820,7 +11885,7 @@ impl DoubleToFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10830,7 +11895,7 @@ impl DoubleToFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10896,7 +11961,7 @@ impl IntToByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10907,7 +11972,7 @@ impl IntToByte { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -10917,7 +11982,7 @@ impl IntToByte { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -10983,7 +12048,7 @@ impl IntToChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -10994,7 +12059,7 @@ impl IntToChar { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11004,7 +12069,7 @@ impl IntToChar { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11070,7 +12135,7 @@ impl IntToShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11081,7 +12146,7 @@ impl IntToShort { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11091,7 +12156,7 @@ impl IntToShort { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11138,7 +12203,7 @@ impl AddInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11149,7 +12214,7 @@ impl AddInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11159,7 +12224,7 @@ impl AddInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11207,7 +12272,7 @@ impl SubInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11218,7 +12283,7 @@ impl SubInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11228,7 +12293,7 @@ impl SubInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11276,7 +12341,7 @@ impl MulInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11287,7 +12352,7 @@ impl MulInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11297,7 +12362,7 @@ impl MulInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11345,7 +12410,7 @@ impl DivInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11356,7 +12421,7 @@ impl DivInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11366,7 +12431,7 @@ impl DivInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11414,7 +12479,7 @@ impl RemInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11425,7 +12490,7 @@ impl RemInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11435,7 +12500,7 @@ impl RemInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11483,7 +12548,7 @@ impl AndInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11494,7 +12559,7 @@ impl AndInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11504,7 +12569,7 @@ impl AndInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11552,7 +12617,7 @@ impl OrInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11563,7 +12628,7 @@ impl OrInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11573,7 +12638,7 @@ impl OrInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11621,7 +12686,7 @@ impl XorInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11632,7 +12697,7 @@ impl XorInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11642,7 +12707,7 @@ impl XorInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11690,7 +12755,7 @@ impl ShlInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11701,7 +12766,7 @@ impl ShlInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11711,7 +12776,7 @@ impl ShlInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11759,7 +12824,7 @@ impl ShrInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11770,7 +12835,7 @@ impl ShrInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11780,7 +12845,7 @@ impl ShrInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11831,7 +12896,7 @@ impl UshrInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11842,7 +12907,7 @@ impl UshrInt { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11852,7 +12917,7 @@ impl UshrInt { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11905,7 +12970,7 @@ impl AddLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11916,7 +12981,7 @@ impl AddLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -11926,7 +12991,7 @@ impl AddLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -11979,7 +13044,7 @@ impl SubLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -11990,7 +13055,7 @@ impl SubLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12000,7 +13065,7 @@ impl SubLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12053,7 +13118,7 @@ impl MulLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12064,7 +13129,7 @@ impl MulLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12074,7 +13139,7 @@ impl MulLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12127,7 +13192,7 @@ impl DivLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12138,7 +13203,7 @@ impl DivLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12148,7 +13213,7 @@ impl DivLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12201,7 +13266,7 @@ impl RemLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12212,7 +13277,7 @@ impl RemLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12222,7 +13287,7 @@ impl RemLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12275,7 +13340,7 @@ impl AndLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12286,7 +13351,7 @@ impl AndLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12296,7 +13361,7 @@ impl AndLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12346,7 +13411,7 @@ impl OrLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12357,7 +13422,7 @@ impl OrLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12367,7 +13432,7 @@ impl OrLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12420,7 +13485,7 @@ impl XorLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12431,7 +13496,7 @@ impl XorLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12441,7 +13506,7 @@ impl XorLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12494,7 +13559,7 @@ impl ShlLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12505,7 +13570,7 @@ impl ShlLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12515,7 +13580,7 @@ impl ShlLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12568,7 +13633,7 @@ impl ShrLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12579,7 +13644,7 @@ impl ShrLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12589,7 +13654,7 @@ impl ShrLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12642,7 +13707,7 @@ impl UshrLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12653,7 +13718,7 @@ impl UshrLong { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12663,7 +13728,7 @@ impl UshrLong { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12714,7 +13779,7 @@ impl AddFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12725,7 +13790,7 @@ impl AddFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12735,7 +13800,7 @@ impl AddFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12786,7 +13851,7 @@ impl SubFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12797,7 +13862,7 @@ impl SubFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12807,7 +13872,7 @@ impl SubFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12858,7 +13923,7 @@ impl MulFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12869,7 +13934,7 @@ impl MulFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12879,7 +13944,7 @@ impl MulFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -12930,7 +13995,7 @@ impl DivFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -12941,7 +14006,7 @@ impl DivFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -12951,7 +14016,7 @@ impl DivFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13002,7 +14067,7 @@ impl RemFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13013,7 +14078,7 @@ impl RemFloat { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13023,7 +14088,7 @@ impl RemFloat { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13076,7 +14141,7 @@ impl AddDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13087,7 +14152,7 @@ impl AddDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13097,7 +14162,7 @@ impl AddDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13150,7 +14215,7 @@ impl SubDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13161,7 +14226,7 @@ impl SubDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13171,7 +14236,7 @@ impl SubDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13224,7 +14289,7 @@ impl MulDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13235,7 +14300,7 @@ impl MulDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13245,7 +14310,7 @@ impl MulDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13298,7 +14363,7 @@ impl DivDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13309,7 +14374,7 @@ impl DivDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13319,7 +14384,7 @@ impl DivDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13372,7 +14437,7 @@ impl RemDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13383,7 +14448,7 @@ impl RemDouble { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13393,7 +14458,7 @@ impl RemDouble { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13460,7 +14525,7 @@ impl AddInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13471,7 +14536,7 @@ impl AddInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13481,7 +14546,7 @@ impl AddInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13547,7 +14612,7 @@ impl SubInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13558,7 +14623,7 @@ impl SubInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13568,7 +14633,7 @@ impl SubInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13634,7 +14699,7 @@ impl MulInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13645,7 +14710,7 @@ impl MulInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13655,7 +14720,7 @@ impl MulInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13721,7 +14786,7 @@ impl DivInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13732,7 +14797,7 @@ impl DivInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13742,7 +14807,7 @@ impl DivInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13808,7 +14873,7 @@ impl RemInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13819,7 +14884,7 @@ impl RemInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13829,7 +14894,7 @@ impl RemInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13895,7 +14960,7 @@ impl AndInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13906,7 +14971,7 @@ impl AndInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -13916,7 +14981,7 @@ impl AndInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -13982,7 +15047,7 @@ impl OrInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -13993,7 +15058,7 @@ impl OrInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14003,7 +15068,7 @@ impl OrInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14069,7 +15134,7 @@ impl XorInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14080,7 +15145,7 @@ impl XorInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14090,7 +15155,7 @@ impl XorInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14156,7 +15221,7 @@ impl ShlInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14167,7 +15232,7 @@ impl ShlInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14177,7 +15242,7 @@ impl ShlInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14243,7 +15308,7 @@ impl ShrInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14254,7 +15319,7 @@ impl ShrInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14264,7 +15329,7 @@ impl ShrInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14330,7 +15395,7 @@ impl UshrInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14341,7 +15406,7 @@ impl UshrInt2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14351,7 +15416,7 @@ impl UshrInt2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14419,7 +15484,7 @@ impl AddLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14430,7 +15495,7 @@ impl AddLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14440,7 +15505,7 @@ impl AddLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14508,7 +15573,7 @@ impl SubLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14519,7 +15584,7 @@ impl SubLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14529,7 +15594,7 @@ impl SubLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14597,7 +15662,7 @@ impl MulLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14608,7 +15673,7 @@ impl MulLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14618,7 +15683,7 @@ impl MulLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14686,7 +15751,7 @@ impl DivLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14697,7 +15762,7 @@ impl DivLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14707,7 +15772,7 @@ impl DivLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14775,7 +15840,7 @@ impl RemLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14786,7 +15851,7 @@ impl RemLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14796,7 +15861,7 @@ impl RemLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14864,7 +15929,7 @@ impl AndLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14875,7 +15940,7 @@ impl AndLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14885,7 +15950,7 @@ impl AndLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -14953,7 +16018,7 @@ impl OrLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -14964,7 +16029,7 @@ impl OrLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -14974,7 +16039,7 @@ impl OrLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15042,7 +16107,7 @@ impl XorLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15053,7 +16118,7 @@ impl XorLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15063,7 +16128,7 @@ impl XorLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15131,7 +16196,7 @@ impl ShlLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15142,7 +16207,7 @@ impl ShlLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15152,7 +16217,7 @@ impl ShlLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15220,7 +16285,7 @@ impl ShrLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15231,7 +16296,7 @@ impl ShrLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15241,7 +16306,7 @@ impl ShrLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15309,7 +16374,7 @@ impl UshrLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15320,7 +16385,7 @@ impl UshrLong2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15330,7 +16395,7 @@ impl UshrLong2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15396,7 +16461,7 @@ impl AddFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15407,7 +16472,7 @@ impl AddFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15417,7 +16482,7 @@ impl AddFloat2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15483,7 +16548,7 @@ impl SubFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15494,7 +16559,7 @@ impl SubFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15504,7 +16569,7 @@ impl SubFloat2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15570,7 +16635,7 @@ impl MulFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15581,7 +16646,7 @@ impl MulFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15591,7 +16656,7 @@ impl MulFloat2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15657,7 +16722,7 @@ impl DivFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15668,7 +16733,7 @@ impl DivFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15678,7 +16743,7 @@ impl DivFloat2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15744,7 +16809,7 @@ impl RemFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15755,7 +16820,7 @@ impl RemFloat2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15765,7 +16830,7 @@ impl RemFloat2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15833,7 +16898,7 @@ impl AddDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15844,7 +16909,7 @@ impl AddDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15854,7 +16919,7 @@ impl AddDouble2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -15922,7 +16987,7 @@ impl SubDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -15933,7 +16998,7 @@ impl SubDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -15943,7 +17008,7 @@ impl SubDouble2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16011,7 +17076,7 @@ impl MulDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16022,7 +17087,7 @@ impl MulDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16032,7 +17097,7 @@ impl MulDouble2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16100,7 +17165,7 @@ impl DivDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16111,7 +17176,7 @@ impl DivDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16121,7 +17186,7 @@ impl DivDouble2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16189,7 +17254,7 @@ impl RemDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16200,7 +17265,7 @@ impl RemDouble2Addr { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16210,7 +17275,7 @@ impl RemDouble2Addr { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16249,7 +17314,7 @@ impl AddIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16292,7 +17357,7 @@ impl AddIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16303,7 +17368,7 @@ impl AddIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16313,7 +17378,7 @@ impl AddIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16322,7 +17387,7 @@ impl AddIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16382,7 +17447,7 @@ impl RsubIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16425,7 +17490,7 @@ impl RsubIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16436,7 +17501,7 @@ impl RsubIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16446,7 +17511,7 @@ impl RsubIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16455,7 +17520,7 @@ impl RsubIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16515,7 +17580,7 @@ impl MulIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16558,7 +17623,7 @@ impl MulIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16569,7 +17634,7 @@ impl MulIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16579,7 +17644,7 @@ impl MulIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16588,7 +17653,7 @@ impl MulIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16648,7 +17713,7 @@ impl DivIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16691,7 +17756,7 @@ impl DivIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16702,7 +17767,7 @@ impl DivIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16712,7 +17777,7 @@ impl DivIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16721,7 +17786,7 @@ impl DivIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16781,7 +17846,7 @@ impl RemIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16824,7 +17889,7 @@ impl RemIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16835,7 +17900,7 @@ impl RemIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16845,7 +17910,7 @@ impl RemIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16854,7 +17919,7 @@ impl RemIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16914,7 +17979,7 @@ impl AndIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -16957,7 +18022,7 @@ impl AndIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -16968,7 +18033,7 @@ impl AndIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -16978,7 +18043,7 @@ impl AndIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -16987,7 +18052,7 @@ impl AndIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -17047,7 +18112,7 @@ impl OrIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -17090,7 +18155,7 @@ impl OrIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17101,7 +18166,7 @@ impl OrIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17111,7 +18176,7 @@ impl OrIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -17120,7 +18185,7 @@ impl OrIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -17180,7 +18245,7 @@ impl XorIntLit { pub fn sanity_check(&self) -> Result<()> { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -17223,7 +18288,7 @@ impl XorIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17234,7 +18299,7 @@ impl XorIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17244,7 +18309,7 @@ impl XorIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -17253,7 +18318,7 @@ impl XorIntLit { /// Return the raw instruction ([`InsFormat`]). pub fn get_raw_ins(&self) -> InsFormat { let mut reg_on_4_bit = true; - let lit_on_8_bits = true; + let mut lit_on_8_bits = true; if self.dest & 0b1111_0000 != 0 { reg_on_4_bit = false; } @@ -17324,7 +18389,7 @@ impl ShlIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17335,7 +18400,7 @@ impl ShlIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17345,7 +18410,7 @@ impl ShlIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -17396,7 +18461,7 @@ impl ShrIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17407,7 +18472,7 @@ impl ShrIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17417,7 +18482,7 @@ impl ShrIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -17468,7 +18533,7 @@ impl UshrIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17479,7 +18544,7 @@ impl UshrIntLit { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17489,7 +18554,7 @@ impl UshrIntLit { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { self.get_raw_ins().size() } } @@ -17533,7 +18598,7 @@ impl InvokePolymorphic { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -17544,9 +18609,7 @@ impl InvokePolymorphic { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -17600,7 +18663,7 @@ impl InvokePolymorphic { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17611,7 +18674,7 @@ impl InvokePolymorphic { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17621,7 +18684,7 @@ impl InvokePolymorphic { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 8 } } @@ -17637,7 +18700,7 @@ impl InvokePolymorphic { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -17653,7 +18716,7 @@ impl InvokePolymorphic { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -17717,7 +18780,7 @@ impl InvokeCustom { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if let Some(last) = last { if r != last + 1 { consec = false; @@ -17728,9 +18791,7 @@ impl InvokeCustom { } last = Some(r); } - if four_bites && len <= 5 { - Ok(()) - } else if consec && len <= 255 { + if (four_bites && len <= 5) || (consec && len <= 255) { Ok(()) } else { Err(anyhow!( @@ -17778,7 +18839,7 @@ impl InvokeCustom { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17789,7 +18850,7 @@ impl InvokeCustom { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17799,7 +18860,7 @@ impl InvokeCustom { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 6 } } @@ -17814,7 +18875,7 @@ impl InvokeCustom { let mut consec = true; let mut four_bites = true; let len = self.args.len(); - for r in self.args { + for r in self.args.iter().cloned() { if first.is_none() { first = Some(r); } @@ -17830,7 +18891,7 @@ impl InvokeCustom { } if four_bites && len <= 5 { let mut regs = vec![]; - for reg in self.args { + for reg in self.args.iter().cloned() { regs.push(reg); } while regs.len() != 5 { @@ -17904,7 +18965,7 @@ impl ConstMethodHandle { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17915,7 +18976,7 @@ impl ConstMethodHandle { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17925,7 +18986,7 @@ impl ConstMethodHandle { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -17977,7 +19038,7 @@ impl ConstMethodType { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -17988,7 +19049,7 @@ impl ConstMethodType { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -17998,7 +19059,7 @@ impl ConstMethodType { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 4 } } @@ -18053,7 +19114,7 @@ impl Try { .map(|(ty, label)| format!(" {}: {label}", ty.__str__())) .collect::>() .join("\n "); - let default_handler = if let Some(label) = self.default_handler { + let default_handler = if let Some(label) = &self.default_handler { format!(" default: {label}") } else { "".into() @@ -18085,7 +19146,7 @@ impl Try { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -18096,7 +19157,7 @@ impl Try { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -18106,7 +19167,7 @@ impl Try { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 0 } } @@ -18141,7 +19202,7 @@ impl Label { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn min_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the bigest size possible for the associated instruction. @@ -18152,7 +19213,7 @@ impl Label { /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. pub fn max_ins_size(&self) -> usize { - self.get_ins_size() + self.ins_size() } /// Return the actual size of the instruction. @@ -18162,7 +19223,7 @@ impl Label { /// The returned size is the size in bytes (`u8`) (the same as the value return /// by the `Serializable::size()` method), but instructions in the bytecode /// count addresses by unit of `u16`. - pub fn get_ins_size(&self) -> usize { + pub fn ins_size(&self) -> usize { 0 } }