/** * Writes three code units to the given output destination, where the * second and third are represented as single <code>int</code> and emitted * in little-endian order. * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1c2 code unit pair to write */ protected static void write(AnnotatedOutput out, short c0, int c1c2) { write(out, c0, (short) c1c2, (short) (c1c2 >> 16)); }
/** * Returns the string form, suitable for inclusion in a listing * dump, of the given instruction. The instruction must be of this * instance's format for proper operation. * * @param insn {@code non-null;} the instruction * @param noteIndices whether to include an explicit notation of * constant pool indices * @return {@code non-null;} the string form */ public final String listingString(DalvInsn insn, boolean noteIndices) { String op = insn.getOpcode().getName(); String arg = insnArgString(insn); String comment = insnCommentString(insn, noteIndices); StringBuilder sb = new StringBuilder(100); sb.append(op); if (arg.length() != 0) { sb.append(' '); sb.append(arg); } if (comment.length() != 0) { sb.append(" // "); sb.append(comment); } return sb.toString(); }
/** {@inheritDoc} */ @Override public final int codeSize() { return getOpcode().getFormat().codeSize(); }
currentOpcode.getFormat().compatibleRegs(insn); prefix = insn.expandedPrefix(compatRegs); suffix = insn.expandedSuffix(compatRegs);
/** {@inheritDoc} */ @Override public void writeTo(AnnotatedOutput out) { if (codeSize() != 0) { out.writeShort(InsnFormat.codeUnit(Opcodes.NOP, 0)); } }
/** {@inheritDoc} */ @Override public final void writeTo(AnnotatedOutput out) { getOpcode().getFormat().writeTo(out, this); }
/** {@inheritDoc} */ @Override protected final String listingString0(boolean noteIndices) { return getOpcode().getFormat().listingString(this, noteIndices); } }
TargetInsn target = (TargetInsn) insn; if (opcode.getFormat().branchFits(target)) { continue;
/** * Attempts to fit the given instruction into a specific opcode, * returning the opcode whose format that the instruction fits * into or {@code null} to indicate that the instruction will need * to be expanded. This fitting process starts with the given * opcode as a first "best guess" and then pessimizes from there * if necessary. * * @param insn {@code non-null;} the instruction in question * @param guess {@code null-ok;} the current guess as to the best * opcode; {@code null} means that no simple opcode fits * @return {@code null-ok;} a possibly-different opcode; either a * {@code non-null} good fit or {@code null} to indicate that no * simple opcode fits */ private Dop findOpcodeForInsn(DalvInsn insn, Dop guess) { /* * Note: The initial guess might be null, meaning that an * earlier call to this method already determined that there * was no possible simple opcode fit. */ while (guess != null) { if (guess.getFormat().isCompatible(insn)) { break; } guess = Dops.getNextOrNull(guess, dexOptions); } return guess; }
if (format.isCompatible(insn)) format= format.nextUp(); if ((format == null) || (format.isCompatible(insn) && (Dops.getOrNull(family, format) != null)))
/** * Returns the string form, suitable for inclusion in a listing * dump, of the given instruction. The instruction must be of this * instance's format for proper operation. * * @param insn {@code non-null;} the instruction * @param noteIndices whether to include an explicit notation of * constant pool indices * @return {@code non-null;} the string form */ public final String listingString(DalvInsn insn, boolean noteIndices) { String op = insn.getOpcode().getName(); String arg = insnArgString(insn); String comment = insnCommentString(insn, noteIndices); StringBuilder sb = new StringBuilder(100); sb.append(op); if (arg.length() != 0) { sb.append(' '); sb.append(arg); } if (comment.length() != 0) { sb.append(" // "); sb.append(comment); } return sb.toString(); }
/** {@inheritDoc} */ @Override public final int codeSize() { return getOpcode().getFormat().codeSize(); }
BitSet compatRegs = expandedOp.getFormat().compatibleRegs(insn); int reserve = insn.getMinimumRegisterRequirement(compatRegs); if (reserve > newReservedCount) {
/** {@inheritDoc} */ @Override public void writeTo(AnnotatedOutput out) { if (codeSize() != 0) { out.writeShort(InsnFormat.codeUnit(Opcodes.NOP, 0)); } }
/** {@inheritDoc} */ @Override public final void writeTo(AnnotatedOutput out) { getOpcode().getFormat().writeTo(out, this); }
/** {@inheritDoc} */ @Override protected final String listingString0(boolean noteIndices) { return getOpcode().getFormat().listingString(this, noteIndices); } }
TargetInsn target = (TargetInsn) insn; if (opcode.getFormat().branchFits(target)) { continue;
/** * Attempts to fit the given instruction into a specific opcode, * returning the opcode whose format that the instruction fits * into or {@code null} to indicate that the instruction will need * to be expanded. This fitting process starts with the given * opcode as a first "best guess" and then pessimizes from there * if necessary. * * @param insn {@code non-null;} the instruction in question * @param guess {@code null-ok;} the current guess as to the best * opcode; {@code null} means that no simple opcode fits * @return {@code null-ok;} a possibly-different opcode; either a * {@code non-null} good fit or {@code null} to indicate that no * simple opcode fits */ private Dop findOpcodeForInsn(DalvInsn insn, Dop guess) { /* * Note: The initial guess might be null, meaning that an * earlier call to this method already determined that there * was no possible simple opcode fit. */ while (guess != null) { if (guess.getFormat().isCompatible(insn)) { break; } guess = Dops.getNextOrNull(guess, dexOptions); } return guess; }
/** * Returns the string form, suitable for inclusion in a listing * dump, of the given instruction. The instruction must be of this * instance's format for proper operation. * * @param insn {@code non-null;} the instruction * @param noteIndices whether to include an explicit notation of * constant pool indices * @return {@code non-null;} the string form */ public final String listingString(DalvInsn insn, boolean noteIndices) { String op = insn.getOpcode().getName(); String arg = insnArgString(insn); String comment = insnCommentString(insn, noteIndices); StringBuilder sb = new StringBuilder(100); sb.append(op); if (arg.length() != 0) { sb.append(' '); sb.append(arg); } if (comment.length() != 0) { sb.append(" // "); sb.append(comment); } return sb.toString(); }
/** * Writes three code units to the given output destination, where the * second and third are represented as single <code>int</code> and emitted * in little-endian order. * * @param out {@code non-null;} where to write to * @param c0 code unit to write * @param c1c2 code unit pair to write */ protected static void write(AnnotatedOutput out, short c0, int c1c2) { write(out, c0, (short) c1c2, (short) (c1c2 >> 16)); }