private static int[] buildRegisters3rc(Instruction3rc instruction) { int registerCount = instruction.getRegisterCount(); int start = instruction.getStartRegister(); int end = start + registerCount; int[] registers = new int[registerCount]; for (int i = start; i < end; i++) { registers[i - start] = i; } return registers; }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), convertReference(instruction.getReference())); }
@Override boolean isUsedAsFloatingPoint(DexBody body, int register) { Instruction3rc i = (Instruction3rc) instruction; Type arrayType = DexType.toSoot((TypeReference) i.getReference()); int startRegister = i.getStartRegister(); int endRegister = startRegister + i.getRegisterCount(); return register >= startRegister && register <= endRegister && isFloatLike(arrayType); }
private boolean analyzeInvokeVirtual(@Nonnull AnalyzedInstruction analyzedInstruction, boolean isRange) { MethodReference targetMethod; if (!normalizeVirtualMethods) { return true; } if (isRange) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; targetMethod = (MethodReference)instruction.getReference(); } else { Instruction35c instruction = (Instruction35c)analyzedInstruction.instruction; targetMethod = (MethodReference)instruction.getReference(); } MethodReference replacementMethod = normalizeMethodReference(targetMethod); if (replacementMethod == null || replacementMethod.equals(targetMethod)) { return true; } Instruction deodexedInstruction; if (isRange) { Instruction3rc instruction = (Instruction3rc)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction3rc(instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), replacementMethod); } else { Instruction35c instruction = (Instruction35c)analyzedInstruction.instruction; deodexedInstruction = new ImmutableInstruction35c(instruction.getOpcode(), instruction.getRegisterCount(), instruction.getRegisterC(), instruction.getRegisterD(), instruction.getRegisterE(), instruction.getRegisterF(), instruction.getRegisterG(), replacementMethod); } analyzedInstruction.setDeodexedInstruction(deodexedInstruction); return true; }
int usedRegister = filledNewArrayInstr.getRegisterCount(); Type t = DexType.toSoot((TypeReference) filledNewArrayInstr.getReference());
public int getRegisterCount() { return instruction.getRegisterCount(); } }
public int getRegisterCount() { return instruction.getRegisterCount(); } }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
@Nonnull private BuilderInstruction3rc newBuilderInstruction3rc(@Nonnull Instruction3rc instruction) { return new BuilderInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), convertReference(instruction.getReference())); }
private void annotateInstruction3rc(@Nonnull AnnotatedBytes out, @Nonnull Instruction3rc instruction) { int startRegister = instruction.getStartRegister(); int endRegister = startRegister + instruction.getRegisterCount() - 1; String reference = ReferenceUtil.getReferenceString(instruction.getReference()); out.annotate(6, String.format("%s {%s .. %s}, %s", instruction.getOpcode().name, formatRegister(startRegister), formatRegister(endRegister), reference)); }
private void annotateInstruction3rc(@Nonnull AnnotatedBytes out, @Nonnull Instruction3rc instruction) { int startRegister = instruction.getStartRegister(); int endRegister = startRegister + instruction.getRegisterCount() - 1; String reference = ReferenceUtil.getReferenceString(instruction.getReference()); out.annotate(6, String.format("%s {%s .. %s}, %s", instruction.getOpcode().name, formatRegister(startRegister), formatRegister(endRegister), reference)); }
private void annotateInstruction3rc(@Nonnull AnnotatedBytes out, @Nonnull Instruction3rc instruction) { int startRegister = instruction.getStartRegister(); int endRegister = startRegister + instruction.getRegisterCount() - 1; String reference = ReferenceUtil.getReferenceString(instruction.getReference()); out.annotate(6, String.format("%s {%s .. %s}, %s", instruction.getOpcode().name, formatRegister(startRegister), formatRegister(endRegister), reference)); }
public static ImmutableInstruction3rc of(Instruction3rc instruction) { if (instruction instanceof ImmutableInstruction3rc) { return (ImmutableInstruction3rc)instruction; } return new ImmutableInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
public static ImmutableInstruction3rc of(Instruction3rc instruction) { if (instruction instanceof ImmutableInstruction3rc) { return (ImmutableInstruction3rc)instruction; } return new ImmutableInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
public static ImmutableInstruction3rc of(Instruction3rc instruction) { if (instruction instanceof ImmutableInstruction3rc) { return (ImmutableInstruction3rc)instruction; } return new ImmutableInstruction3rc( instruction.getOpcode(), instruction.getStartRegister(), instruction.getRegisterCount(), instruction.getReference()); }
public void write(@Nonnull Instruction3rc instruction) { try { writer.write(instruction.getOpcode().value); writer.write(instruction.getRegisterCount()); writer.writeUshort(getReferenceIndex(instruction)); writer.writeUshort(instruction.getStartRegister()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction3rc instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(instruction.getRegisterCount()); writer.writeUshort(getReferenceIndex(instruction)); writer.writeUshort(instruction.getStartRegister()); } catch (IOException ex) { throw new RuntimeException(ex); } }
public void write(@Nonnull Instruction3rc instruction) { try { writer.write(getOpcodeValue(instruction.getOpcode())); writer.write(instruction.getRegisterCount()); writer.writeUshort(getReferenceIndex(instruction)); writer.writeUshort(instruction.getStartRegister()); } catch (IOException ex) { throw new RuntimeException(ex); } }