BasicBlock toBasicBlock() { InsnList result = new InsnList(instructions.size()); for (int i = 0; i < instructions.size(); i++) { result.set(i, instructions.get(i)); } result.setImmutable(); int primarySuccessorIndex = -1; IntList successors = new IntList(); for (Label catchLabel : catchLabels) { successors.add(catchLabel.id); } if (primarySuccessor != null) { primarySuccessorIndex = primarySuccessor.id; successors.add(primarySuccessorIndex); } if (alternateSuccessor != null) { successors.add(alternateSuccessor.id); } successors.setImmutable(); return new BasicBlock(id, result, successors, primarySuccessorIndex); } }
byte[] bytes = NuwaProcessor.referHackWhenInit(classFile.getBytes().makeDataInputStream());
/** * Make IntSet for the dominance-frontier sets. * * @param szBlocks {@code >=0;} count of basic blocks in method * @return {@code non-null;} appropriate set */ /*package*/ static IntSet makeDomFrontSet(int szBlocks) { return szBlocks <= DOMFRONT_SET_THRESHOLD_SIZE ? new BitIntSet(szBlocks) : new ListIntSet(); }
/** * Gets a {@code DataInputStream} that reads from this instance, * with the cursor starting at the beginning of this instance's data. * <b>Note:</b> The returned instance may be cast to {@link GetCursor} * if needed. * * @return {@code non-null;} an appropriately-constructed * {@code DataInputStream} instance */ public MyDataInputStream makeDataInputStream() { return new MyDataInputStream(makeInputStream()); }
/** {@inheritDoc} */ @Override public void shrinkToFit() { super.shrinkToFit(); rebuildLabelToIndex(); }
/** {@inheritDoc} */ @Override public void add(int value) { ensureCapacity(value); Bits.set(bits, value, true); }
/** {@inheritDoc} */ @Override public void setImmutable() { values.setImmutable(); targets.setImmutable(); super.setImmutable(); }
/** * Throws the right exception for an invalid cpi. * * @param idx the bad cpi * @return never * @throws ExceptionWithContext always thrown */ private static Constant throwInvalid(int idx) { throw new ExceptionWithContext("invalid constant pool index " + Hex.u2(idx)); } }
/** {@inheritDoc} */ public int writeUleb128(int value) { if (stretchy) { ensureCapacity(cursor + 5); // pessimistic } int cursorBefore = cursor; Leb128Utils.writeUnsignedLeb128(this, value); return (cursor - cursorBefore); }
/** * Gets the literal value, masked to be a byte in size. This will * throw if the value is out of the range of a signed byte. */ public final int getLiteralByte() { if (literal != (byte) literal) { throw new DexException("Literal out of range: " + Hex.u8(literal)); } return (int) literal & 0xff; }
/** * Make IntSet for the interference graph sets. Public because * InterferenceGraph is in another package. * * @param countRegs {@code >=0;} count of SSA registers used in method * @return {@code non-null;} appropriate set */ public static IntSet makeInterferenceSet(int countRegs) { return countRegs <= INTERFERENCE_SET_THRESHOLD_SIZE ? new BitIntSet(countRegs) : new ListIntSet(); }
/** * Gets a {@code DataInputStream} that reads from this instance, * with the cursor starting at the beginning of this instance's data. * <b>Note:</b> The returned instance may be cast to {@link GetCursor} * if needed. * * @return {@code non-null;} an appropriately-constructed * {@code DataInputStream} instance */ public MyDataInputStream makeDataInputStream() { return new MyDataInputStream(makeInputStream()); }
/** {@inheritDoc} */ @Override public void shrinkToFit() { super.shrinkToFit(); rebuildLabelToIndex(); }
/** {@inheritDoc} */ public void add(int value) { ensureCapacity(value); Bits.set(bits, value, true); }
/** {@inheritDoc} */ @Override public void setImmutable() { values.setImmutable(); targets.setImmutable(); super.setImmutable(); }
/** * Make IntSet for register live in/out sets. * * @param countRegs {@code >=0;} count of SSA registers used in method * @return {@code non-null;} appropriate set */ /*package*/ static IntSet makeLivenessSet(int countRegs) { return countRegs <= LIVENESS_SET_THRESHOLD_SIZE ? new BitIntSet(countRegs) : new ListIntSet(); } }
/** * Gets a {@code DataInputStream} that reads from this instance, * with the cursor starting at the beginning of this instance's data. * <b>Note:</b> The returned instance may be cast to {@link #GetCursor} * if needed. * * @return {@code non-null;} an appropriately-constructed * {@code DataInputStream} instance */ public MyDataInputStream makeDataInputStream() { return new MyDataInputStream(makeInputStream()); }
/** * Make IntSet for the interference graph sets. Public because * InterferenceGraph is in another package. * * @param countRegs {@code >=0;} count of SSA registers used in method * @return {@code non-null;} appropriate set */ public static IntSet makeInterferenceSet(int countRegs) { return countRegs <= INTERFERENCE_SET_THRESHOLD_SIZE ? new BitIntSet(countRegs) : new ListIntSet(); }
/** * Make IntSet for register live in/out sets. * * @param countRegs {@code >=0;} count of SSA registers used in method * @return {@code non-null;} appropriate set */ /*package*/ static IntSet makeLivenessSet(int countRegs) { return countRegs <= LIVENESS_SET_THRESHOLD_SIZE ? new BitIntSet(countRegs) : new ListIntSet(); } }
/** * Make IntSet for the dominance-frontier sets. * * @param szBlocks {@code >=0;} count of basic blocks in method * @return {@code non-null;} appropriate set */ /*package*/ static IntSet makeDomFrontSet(int szBlocks) { return szBlocks <= DOMFRONT_SET_THRESHOLD_SIZE ? new BitIntSet(szBlocks) : new ListIntSet(); }