protected void writeCommentIfLikelyDouble(IndentingWriter writer) throws IOException { writeCommentIfLikelyDouble(writer, ((WideLiteralInstruction)instruction).getWideLiteral()); }
protected void writeFirstRegister(IndentingWriter writer) throws IOException { writeRegister(writer, ((OneRegisterInstruction)instruction).getRegisterA()); }
protected void writeCommentIfLikelyFloat(IndentingWriter writer) throws IOException { writeCommentIfLikelyFloat(writer, ((NarrowLiteralInstruction)instruction).getNarrowLiteral()); }
String referenceString = writeInvalidItemIndex(ex, referenceInstruction.getReferenceType(), writer); referenceWritable = indentingWriter -> writer.write(referenceString); } catch (InvalidItemIndex ex) { commentOutInstruction = true; String referenceString = writeInvalidItemIndex(ex, dualReferenceInstruction.getReferenceType2(), writer); referenceWritable2 = indentingWriter -> indentingWriter.write(referenceString); if (!isAllowedOdex(opcode)) { writer.write("#disallowed odex opcode\n"); commentOutInstruction = true; writeOpcode(writer); writer.write(' '); writeTargetLabel(writer); break; case Format10x: writeOpcode(writer); break; case Format11n: writeOpcode(writer); writer.write(' '); writeFirstRegister(writer); writer.write(", "); writeLiteral(writer); break;
public static InstructionMethodItem makeInstructionFormatMethodItem( MethodDefinition methodDef, int codeAddress, Instruction instruction) { if (instruction instanceof OffsetInstruction) { return new OffsetInstructionFormatMethodItem(methodDef.classDef.options, methodDef, codeAddress, (OffsetInstruction)instruction); } if (instruction instanceof UnresolvedOdexInstruction) { return new UnresolvedOdexInstructionMethodItem(methodDef, codeAddress, (UnresolvedOdexInstruction)instruction); } switch (instruction.getOpcode().format) { case ArrayPayload: return new ArrayDataMethodItem(methodDef, codeAddress, (ArrayPayload)instruction); case PackedSwitchPayload: return new PackedSwitchMethodItem(methodDef, codeAddress, (PackedSwitchPayload)instruction); case SparseSwitchPayload: return new SparseSwitchMethodItem(methodDef, codeAddress, (SparseSwitchPayload)instruction); default: return new InstructionMethodItem<Instruction>(methodDef, codeAddress, instruction); } } }
public boolean writeTo(IndentingWriter writer) throws IOException { writeThrowTo(writer); return true; }
private void writeThrowTo(IndentingWriter writer) throws IOException { writer.write("#Replaced unresolvable odex instruction with a throw\n"); writer.write("throw "); writeRegister(writer, instruction.objectRegisterNum); } }
Instruction instruction = effectiveInstructions.get(i); MethodItem methodItem = InstructionMethodItemFactory.makeInstructionFormatMethodItem(this, currentCodeAddress, instruction);
@Override public boolean writeTo(IndentingWriter writer) throws IOException { writer.write(".packed-switch "); IntegerRenderer.writeTo(writer, firstKey); writer.indent(4); writer.write('\n'); int key = firstKey; for (PackedSwitchTarget target: targets) { target.writeTargetTo(writer); writeResourceId(writer, key); writer.write('\n'); key++; } writer.deindent(4); writer.write(".end packed-switch"); return true; }
protected boolean writeCommentIfResourceId(IndentingWriter writer) throws IOException { return writeCommentIfResourceId(writer, ((NarrowLiteralInstruction)instruction).getNarrowLiteral()); }
public static InstructionMethodItem makeInstructionFormatMethodItem( MethodDefinition methodDef, int codeAddress, Instruction instruction) { if (instruction instanceof OffsetInstruction) { return new OffsetInstructionFormatMethodItem(methodDef.classDef.options, methodDef, codeAddress, (OffsetInstruction)instruction); } if (instruction instanceof UnresolvedOdexInstruction) { return new UnresolvedOdexInstructionMethodItem(methodDef, codeAddress, (UnresolvedOdexInstruction)instruction); } switch (instruction.getOpcode().format) { case ArrayPayload: return new ArrayDataMethodItem(methodDef, codeAddress, (ArrayPayload)instruction); case PackedSwitchPayload: return new PackedSwitchMethodItem(methodDef, codeAddress, (PackedSwitchPayload)instruction); case SparseSwitchPayload: return new SparseSwitchMethodItem(methodDef, codeAddress, (SparseSwitchPayload)instruction); default: return new InstructionMethodItem<Instruction>(methodDef, codeAddress, instruction); } } }
protected void writeThirdRegister(IndentingWriter writer) throws IOException { writeRegister(writer, ((ThreeRegisterInstruction) instruction).getRegisterC()); }
public boolean writeTo(IndentingWriter writer) throws IOException { writeThrowTo(writer); return true; }
private void writeThrowTo(IndentingWriter writer) throws IOException { writer.write("#Replaced unresolvable odex instruction with a throw\n"); writer.write("throw "); writeRegister(writer, instruction.objectRegisterNum); } }
AnalyzedInstruction instruction = instructions.get(i); MethodItem methodItem = InstructionMethodItemFactory.makeInstructionFormatMethodItem( this, currentCodeAddress, instruction.getInstruction()); InstructionMethodItemFactory.makeInstructionFormatMethodItem( this, currentCodeAddress, instruction.getOriginalInstruction())));
public static InstructionMethodItem makeInstructionFormatMethodItem( MethodDefinition methodDef, int codeAddress, Instruction instruction) { if (instruction instanceof OffsetInstruction) { return new OffsetInstructionFormatMethodItem(methodDef.classDef.options, methodDef, codeAddress, (OffsetInstruction)instruction); } if (instruction instanceof UnresolvedOdexInstruction) { return new UnresolvedOdexInstructionMethodItem(methodDef, codeAddress, (UnresolvedOdexInstruction)instruction); } switch (instruction.getOpcode().format) { case ArrayPayload: return new ArrayDataMethodItem(methodDef, codeAddress, (ArrayPayload)instruction); case PackedSwitchPayload: return new PackedSwitchMethodItem(methodDef, codeAddress, (PackedSwitchPayload)instruction); case SparseSwitchPayload: return new SparseSwitchMethodItem(methodDef, codeAddress, (SparseSwitchPayload)instruction); default: return new InstructionMethodItem<Instruction>(methodDef, codeAddress, instruction); } } }
protected void writeSecondRegister(IndentingWriter writer) throws IOException { writeRegister(writer, ((TwoRegisterInstruction)instruction).getRegisterB()); }
public boolean writeTo(IndentingWriter writer) throws IOException { writeThrowTo(writer); return true; }
private void writeThrowTo(IndentingWriter writer) throws IOException { writer.write("#Replaced unresolvable odex instruction with a throw\n"); writer.write("throw "); writeRegister(writer, instruction.objectRegisterNum); } }
switch (regCount) { case 1: writeRegister(writer, instruction.getRegisterC()); break; case 2: writeRegister(writer, instruction.getRegisterC()); writer.write(", "); writeRegister(writer, instruction.getRegisterD()); break; case 3: writeRegister(writer, instruction.getRegisterC()); writer.write(", "); writeRegister(writer, instruction.getRegisterD()); writer.write(", "); writeRegister(writer, instruction.getRegisterE()); break; case 4: writeRegister(writer, instruction.getRegisterC()); writer.write(", "); writeRegister(writer, instruction.getRegisterD()); writer.write(", "); writeRegister(writer, instruction.getRegisterE()); writer.write(", "); writeRegister(writer, instruction.getRegisterF()); break; case 5: writeRegister(writer, instruction.getRegisterC()); writer.write(", "); writeRegister(writer, instruction.getRegisterD());