本文整理汇总了Java中com.sun.tools.classfile.Instruction.getPC方法的典型用法代码示例。如果您正苦于以下问题:Java Instruction.getPC方法的具体用法?Java Instruction.getPC怎么用?Java Instruction.getPC使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.classfile.Instruction
的用法示例。
在下文中一共展示了Instruction.getPC方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeDetails
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
@Override
void writeDetails(Instruction instr) {
String indent = space(2); // get from Options?
int pc = instr.getPC();
List<Note> notes = pcMap.get(pc);
if (notes != null) {
for (Note n: notes) {
print(indent);
print("@");
annotationWriter.write(n.anno, false, true);
print(", ");
println(StringUtils.toLowerCase(n.kind.toString()));
}
}
}
示例2: writeTrys
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
public void writeTrys(Instruction instr, NoteKind kind) {
String indent = space(2); // get from Options?
int pc = instr.getPC();
List<Exception_data> entries = pcMap.get(pc);
if (entries != null) {
for (ListIterator<Exception_data> iter =
entries.listIterator(kind == NoteKind.END ? entries.size() : 0);
kind == NoteKind.END ? iter.hasPrevious() : iter.hasNext() ; ) {
Exception_data entry =
kind == NoteKind.END ? iter.previous() : iter.next();
if (kind.match(entry, pc)) {
print(indent);
print(kind.text);
print("[");
print(indexMap.get(entry));
print("] ");
if (entry.catch_type == 0)
print("finally");
else {
print("#" + entry.catch_type);
print(" // ");
constantWriter.write(entry.catch_type);
}
println();
}
}
}
}
示例3: visitLookupSwitch
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
public Void visitLookupSwitch(Instruction instr,
int default_, int npairs, int[] matches, int[] offsets, Integer indent) {
int pc = instr.getPC();
print("{ // " + npairs);
indent(indent);
for (int i = 0; i < npairs; i++) {
print(String.format("%n%12d: %d", matches[i], (pc + offsets[i])));
}
print("\n default: " + (pc + default_) + "\n}");
indent(-indent);
return null;
}
示例4: visitTableSwitch
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
public Void visitTableSwitch(Instruction instr,
int default_, int low, int high, int[] offsets, Integer indent) {
int pc = instr.getPC();
print("{ // " + low + " to " + high);
indent(indent);
for (int i = 0; i < offsets.length; i++) {
print(String.format("%n%12d: %d", (low + i), (pc + offsets[i])));
}
print("\n default: " + (pc + default_) + "\n}");
indent(-indent);
return null;
}
示例5: visitLookupSwitch
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
@Override
public Element visitLookupSwitch(Instruction i, int i1, int i2, int[] ints,
int[] ints1, Void p) {
Element ie = new Element(i.getMnemonic());
int pc = i.getPC();
ie.setAttr("lab", "" + (pc + i1));
for (int k = 0 ; k < i2 ; k++) {
Element c = new Element("Case");
c.setAttr("num", "" + (ints[k]));
c.setAttr("lab", "" + (pc + ints1[k]));
c.trimToSize();
ie.add(c);
}
return ie;
}
示例6: visitTableSwitch
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
@Override
public Element visitTableSwitch(Instruction i, int i1, int i2, int i3,
int[] ints, Void p) {
Element ie = new Element(i.getMnemonic());
int pc = i.getPC();
ie.setAttr("lab", "" + (pc + i1));
for (int k : ints) {
Element c = new Element("Case");
c.setAttr("num", "" + (k + i2));
c.setAttr("lab", "" + (pc + k));
c.trimToSize();
ie.add(c);
}
return ie;
}
示例7: writeDetails
import com.sun.tools.classfile.Instruction; //导入方法依赖的package包/类
public void writeDetails(Instruction instr) {
int pc = instr.getPC();
writeLocalVariables(pc, NoteKind.END);
writeLocalVariables(pc, NoteKind.START);
}