/** * Constructs an instance. * * @param method {@code non-null;} constant for the method * @param accessFlags access flags * @param code {@code null-ok;} code for the method, if it is neither * {@code abstract} nor {@code native} * @param throwsList {@code non-null;} list of possibly-thrown exceptions, * just used in generating debugging output (listings) */ public EncodedMethod(CstMethodRef method, int accessFlags, DalvCode code, TypeList throwsList) { super(accessFlags); if (method == null) { throw new NullPointerException("method == null"); } this.method = method; if (code == null) { this.code = null; } else { boolean isStatic = (accessFlags & AccessFlags.ACC_STATIC) != 0; this.code = new CodeItem(method, code, isStatic, throwsList); } }
/** {@inheritDoc} */ @Override public String toString() { return "CodeItem{" + toHuman() + "}"; }
protected void writeTo0(DexFile file, AnnotatedOutput out) { boolean annotates = out.annotates(); int regSz = getRegistersSize(); int outsSz = getOutsSize(); int insSz = getInsSize(); int insnsSz = code.getInsns().codeSize(); boolean needPadding = (insnsSz & 1) != 0; out.annotate(0, offsetString() + ' ' + ref.toHuman()); out.annotate(2, " registers_size: " + Hex.u2(regSz)); out.annotate(2, " ins_size: " + Hex.u2(insSz)); out.writeInt(insnsSz); writeCodes(file, out);
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** {@inheritDoc} */ @Override public void debugPrint(PrintWriter out, boolean verbose) { if (code == null) { out.println(getRef().toHuman() + ": abstract or native"); } else { code.debugPrint(out, " ", verbose); } }
setWriteSize(HEADER_SIZE + (insnsSize * 2) + catchesSize);
protected void writeTo0(DexFile file, AnnotatedOutput out) { boolean annotates = out.annotates(); int regSz = getRegistersSize(); int outsSz = getOutsSize(); int insSz = getInsSize(); int insnsSz = code.getInsns().codeSize(); boolean needPadding = (insnsSz & 1) != 0; out.annotate(0, offsetString() + ' ' + ref.toHuman()); out.annotate(2, " registers_size: " + Hex.u2(regSz)); out.annotate(2, " ins_size: " + Hex.u2(insSz)); out.writeInt(insnsSz); writeCodes(file, out);
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** {@inheritDoc} */ @Override public void debugPrint(PrintWriter out, boolean verbose) { if (code == null) { out.println(getRef().toHuman() + ": abstract or native"); } else { code.debugPrint(out, " ", verbose); } }
setWriteSize(HEADER_SIZE + (insnsSize * 2) + catchesSize);
protected void writeTo0(DexFile file, AnnotatedOutput out) { boolean annotates = out.annotates(); int regSz = getRegistersSize(); int outsSz = getOutsSize(); int insSz = getInsSize(); int insnsSz = code.getInsns().codeSize(); boolean needPadding = (insnsSz & 1) != 0; out.annotate(0, offsetString() + ' ' + ref.toHuman()); out.annotate(2, " registers_size: " + Hex.u2(regSz)); out.annotate(2, " ins_size: " + Hex.u2(insSz)); out.writeInt(insnsSz); writeCodes(file, out);
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** {@inheritDoc} */ @Override public void debugPrint(PrintWriter out, boolean verbose) { if (code == null) { out.println(getRef().toHuman() + ": abstract or native"); } else { code.debugPrint(out, " ", verbose); } }
/** {@inheritDoc} */ @Override public String toString() { return "CodeItem{" + toHuman() + "}"; }
/** * Constructs an instance. * * @param method {@code non-null;} constant for the method * @param accessFlags access flags * @param code {@code null-ok;} code for the method, if it is neither * {@code abstract} nor {@code native} * @param throwsList {@code non-null;} list of possibly-thrown exceptions, * just used in generating debugging output (listings) */ public EncodedMethod(CstMethodRef method, int accessFlags, DalvCode code, TypeList throwsList) { super(accessFlags); if (method == null) { throw new NullPointerException("method == null"); } this.method = method; if (code == null) { this.code = null; } else { boolean isStatic = (accessFlags & AccessFlags.ACC_STATIC) != 0; this.code = new CodeItem(method, code, isStatic, throwsList); } }
setWriteSize(HEADER_SIZE + (insnsSize * 2) + catchesSize);
protected void writeTo0(DexFile file, AnnotatedOutput out) { boolean annotates = out.annotates(); int regSz = getRegistersSize(); int outsSz = getOutsSize(); int insSz = getInsSize(); int insnsSz = code.getInsns().codeSize(); boolean needPadding = (insnsSz & 1) != 0; out.annotate(0, offsetString() + ' ' + ref.toHuman()); out.annotate(2, " registers_size: " + Hex.u2(regSz)); out.annotate(2, " ins_size: " + Hex.u2(insSz)); out.writeInt(insnsSz); writeCodes(file, out);
/** * Does a human-friendly dump of this instance. * * @param out {@code non-null;} where to dump * @param prefix {@code non-null;} per-line prefix to use * @param verbose whether to be verbose with the output */ public void debugPrint(PrintWriter out, String prefix, boolean verbose) { out.println(ref.toHuman() + ":"); DalvInsnList insns = code.getInsns(); out.println("regs: " + Hex.u2(getRegistersSize()) + "; ins: " + Hex.u2(getInsSize()) + "; outs: " + Hex.u2(getOutsSize())); insns.debugPrint(out, prefix, verbose); String prefix2 = prefix + " "; if (catches != null) { out.print(prefix); out.println("catches"); catches.debugPrint(out, prefix2); } if (debugInfo != null) { out.print(prefix); out.println("debug info"); debugInfo.debugPrint(out, prefix2); } }
/** {@inheritDoc} */ @Override public void debugPrint(PrintWriter out, boolean verbose) { if (code == null) { out.println(getRef().toHuman() + ": abstract or native"); } else { code.debugPrint(out, " ", verbose); } }
/** {@inheritDoc} */ @Override public String toString() { return "CodeItem{" + toHuman() + "}"; }