Methods Summary |
---|
private void | appendLabel(oracle.toplink.libraries.asm.Label l)Appends the name of the given label to {@link #buf buf}. The given label
must already have a name. One way to ensure this is to always call
{@link #declareLabel declared} before calling this method.
buf.append((String)labelNames.get(l));
|
private void | declareLabel(oracle.toplink.libraries.asm.Label l)Appends a declaration of the given label to {@link #buf buf}. This
declaration is of the form "Label lXXX = new Label();". Does nothing
if the given label has already been declared.
String name = (String)labelNames.get(l);
if (name == null) {
name = "l" + labelNames.size();
labelNames.put(l, name);
buf.append("Label ")
.append(name)
.append(" = new Label();\n");
}
|
public void | printAttribute(oracle.toplink.libraries.asm.Attribute attr)
if (attr instanceof ASMifiable) {
buf.append("// CODE ATTRIBUTE\n");
((ASMifiable)attr).asmify(buf, "cv", labelNames);
} else {
buf.append("// WARNING! skipped a non standard code attribute of type \"");
buf.append(attr.type).append("\"\n");
}
|
public void | printFieldInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
buf.append("cv.visitFieldInsn(")
.append(OPCODES[opcode])
.append(", ");
ASMifierClassVisitor.appendConstant(buf, owner);
buf.append(", ");
ASMifierClassVisitor.appendConstant(buf, name);
buf.append(", ");
ASMifierClassVisitor.appendConstant(buf, desc);
buf.append(");\n");
|
public void | printIincInsn(int var, int increment)
buf.append("cv.visitIincInsn(")
.append(var)
.append(", ")
.append(increment)
.append(");\n");
|
public void | printInsn(int opcode)
buf.append("cv.visitInsn(").
append(OPCODES[opcode]).
append(");\n");
|
public void | printIntInsn(int opcode, int operand)
buf.append("cv.visitIntInsn(").
append(OPCODES[opcode]).
append(", ").
append(operand).
append(");\n");
|
public void | printJumpInsn(int opcode, oracle.toplink.libraries.asm.Label label)
declareLabel(label);
buf.append("cv.visitJumpInsn(")
.append(OPCODES[opcode])
.append(", ");
appendLabel(label);
buf.append(");\n");
|
public void | printLabel(oracle.toplink.libraries.asm.Label label)
declareLabel(label);
buf.append("cv.visitLabel(");
appendLabel(label);
buf.append(");\n");
|
public void | printLdcInsn(java.lang.Object cst)
buf.append("cv.visitLdcInsn(");
ASMifierClassVisitor.appendConstant(buf, cst);
buf.append(");\n");
|
public void | printLineNumber(int line, oracle.toplink.libraries.asm.Label start)
buf.append("cv.visitLineNumber(")
.append(line)
.append(", ");
appendLabel(start);
buf.append(");\n");
|
public void | printLocalVariable(java.lang.String name, java.lang.String desc, oracle.toplink.libraries.asm.Label start, oracle.toplink.libraries.asm.Label end, int index)
buf.append("cv.visitLocalVariable(");
ASMifierClassVisitor.appendConstant(buf, name);
buf.append(", ");
ASMifierClassVisitor.appendConstant(buf, desc);
buf.append(", ");
appendLabel(start);
buf.append(", ");
appendLabel(end);
buf.append(", ").append(index).append(");\n");
|
public void | printLookupSwitchInsn(oracle.toplink.libraries.asm.Label dflt, int[] keys, oracle.toplink.libraries.asm.Label[] labels)
for (int i = 0; i < labels.length; ++i) {
declareLabel(labels[i]);
}
declareLabel(dflt);
buf.append("cv.visitLookupSwitchInsn(");
appendLabel(dflt);
buf.append(", new int[] {");
for (int i = 0; i < keys.length; ++i) {
buf.append(i == 0 ? " " : ", ").append(keys[i]);
}
buf.append(" }, new Label[] {");
for (int i = 0; i < labels.length; ++i) {
buf.append(i == 0 ? " " : ", ");
appendLabel(labels[i]);
}
buf.append(" });\n");
|
public void | printMaxs(int maxStack, int maxLocals)
buf.append("cv.visitMaxs(")
.append(maxStack)
.append(", ")
.append(maxLocals)
.append(");\n");
|
public void | printMethodInsn(int opcode, java.lang.String owner, java.lang.String name, java.lang.String desc)
buf.append("cv.visitMethodInsn(")
.append(OPCODES[opcode])
.append(", ");
ASMifierClassVisitor.appendConstant(buf, owner);
buf.append(", ");
ASMifierClassVisitor.appendConstant(buf, name);
buf.append(", ");
ASMifierClassVisitor.appendConstant(buf, desc);
buf.append(");\n");
|
public void | printMultiANewArrayInsn(java.lang.String desc, int dims)
buf.append("cv.visitMultiANewArrayInsn(");
ASMifierClassVisitor.appendConstant(buf, desc);
buf.append(", ")
.append(dims)
.append(");\n");
|
public void | printTableSwitchInsn(int min, int max, oracle.toplink.libraries.asm.Label dflt, oracle.toplink.libraries.asm.Label[] labels)
for (int i = 0; i < labels.length; ++i) {
declareLabel(labels[i]);
}
declareLabel(dflt);
buf.append("cv.visitTableSwitchInsn(")
.append(min)
.append(", ")
.append(max)
.append(", ");
appendLabel(dflt);
buf.append(", new Label[] {");
for (int i = 0; i < labels.length; ++i) {
buf.append(i == 0 ? " " : ", ");
appendLabel(labels[i]);
}
buf.append(" });\n");
|
public void | printTryCatchBlock(oracle.toplink.libraries.asm.Label start, oracle.toplink.libraries.asm.Label end, oracle.toplink.libraries.asm.Label handler, java.lang.String type)
buf.append("cv.visitTryCatchBlock(");
appendLabel(start);
buf.append(", ");
appendLabel(end);
buf.append(", ");
appendLabel(handler);
buf.append(", ");
ASMifierClassVisitor.appendConstant(buf, type);
buf.append(");\n");
|
public void | printTypeInsn(int opcode, java.lang.String desc)
buf.append("cv.visitTypeInsn(").
append(OPCODES[opcode]).
append(", ");
ASMifierClassVisitor.appendConstant(buf, desc);
buf.append(");\n");
|
public void | printVarInsn(int opcode, int var)
buf.append("cv.visitVarInsn(").
append(OPCODES[opcode]).
append(", ").
append(var).
append(");\n");
|