/** * Gets the next {@link Dop} in the instruction fitting chain after the * given instance, if any. * * @param opcode {@code non-null;} the opcode * @param options {@code non-null;} options, used to determine * which opcodes are potentially off-limits * @return {@code null-ok;} the next opcode in the same family, in the * chain of opcodes to try, or {@code null} if the given opcode is * the last in its chain */ public static Dop getNextOrNull(Dop opcode, DexOptions options) { int nextOpcode = opcode.getNextOpcode(); if (nextOpcode == Opcodes.NO_NEXT) { return null; } opcode = get(nextOpcode); return opcode; }
/** * 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; }
dop= Dops.getOrNull(dop.getFamily(), format); insns.set(i, insn.withOpcode(dop));
dop= Dops.getOrNull(dop.getFamily(), newFormat); insn= insn.withOpcode(dop); insns.set(i, insn);
/** * Gets the next {@link Dop} in the instruction fitting chain after the * given instance, if any. * * @param opcode {@code non-null;} the opcode * @param options {@code non-null;} options, used to determine * which opcodes are potentially off-limits * @return {@code null-ok;} the next opcode in the same family, in the * chain of opcodes to try, or {@code null} if the given opcode is * the last in its chain */ public static Dop getNextOrNull(Dop opcode, DexOptions options) { int nextOpcode = opcode.getNextOpcode(); if (nextOpcode == Opcodes.NO_NEXT) { return null; } opcode = get(nextOpcode); return opcode; }
/** * 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; }
dop= Dops.getOrNull(dop.getFamily(), currentFormat); insn= insn.withOpcode(dop);
/** * Gets the next {@link Dop} in the instruction fitting chain after the * given instance, if any. * * @param opcode {@code non-null;} the opcode * @param options {@code non-null;} options, used to determine * which opcodes are potentially off-limits * @return {@code null-ok;} the next opcode in the same family, in the * chain of opcodes to try, or {@code null} if the given opcode is * the last in its chain */ public static Dop getNextOrNull(Dop opcode, DexOptions options) { int nextOpcode = opcode.getNextOpcode(); if (nextOpcode == Opcodes.NO_NEXT) { return null; } opcode = get(nextOpcode); return opcode; }
/** * 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 == null) || (format.isCompatible(insn) && (Dops.getOrNull(family, format) != null)))
/** * Gets the next {@link Dop} in the instruction fitting chain after the * given instance, if any. * * @param opcode {@code non-null;} the opcode * @param options {@code non-null;} options, used to determine * which opcodes are potentially off-limits * @return {@code null-ok;} the next opcode in the same family, in the * chain of opcodes to try, or {@code null} if the given opcode is * the last in its chain */ public static Dop getNextOrNull(Dop opcode, DexOptions options) { int nextOpcode = opcode.getNextOpcode(); if (nextOpcode == Opcodes.NO_NEXT) { return null; } opcode = get(nextOpcode); return opcode; }
guess = Dops.getNextOrNull(guess, dexOptions);
opcode = get(nextOpcode);
guess = Dops.getNextOrNull(guess, dexOptions);
opcode = get(nextOpcode);
guess = Dops.getNextOrNull(guess, dexOptions);
opcode = get(nextOpcode);
guess = Dops.getNextOrNull(guess, dexOptions);