use of com.sun.tools.classfile.LocalVariableTable_attribute in project jdk8u_jdk by JetBrains.
the class AnnotationsElementVisitor method visitLocalVariableTable.
@Override
public Element visitLocalVariableTable(LocalVariableTable_attribute lvt, Element p) {
String name = x.getCpString(lvt.attribute_name_index);
for (LocalVariableTable_attribute.Entry e : lvt.local_variable_table) {
Element l = new Element(name);
l.setAttr("bci", "" + e.start_pc);
l.setAttr("span", "" + e.length);
l.setAttr("name", x.getCpString(e.name_index));
l.setAttr("type", x.getCpString(e.descriptor_index));
l.setAttr("slot", "" + e.index);
l.trimToSize();
p.add(l);
}
// already added to parent
return null;
}
use of com.sun.tools.classfile.LocalVariableTable_attribute in project ceylon-compiler by ceylon.
the class AttributeWriter method visitLocalVariableTable.
public Void visitLocalVariableTable(LocalVariableTable_attribute attr, Void ignore) {
println("LocalVariableTable:");
indent(+1);
println("Start Length Slot Name Signature");
for (LocalVariableTable_attribute.Entry entry : attr.local_variable_table) {
Formatter formatter = new Formatter();
println(formatter.format("%8d %7d %5d %5s %s", entry.start_pc, entry.length, entry.index, constantWriter.stringValue(entry.name_index), constantWriter.stringValue(entry.descriptor_index)));
}
indent(-1);
return null;
}
use of com.sun.tools.classfile.LocalVariableTable_attribute in project ceylon-compiler by ceylon.
the class LocalVariableTableWriter method reset.
public void reset(Code_attribute attr) {
codeAttr = attr;
pcMap = new HashMap<Integer, List<LocalVariableTable_attribute.Entry>>();
LocalVariableTable_attribute lvt = (LocalVariableTable_attribute) (attr.attributes.get(Attribute.LocalVariableTable));
if (lvt == null)
return;
for (int i = 0; i < lvt.local_variable_table.length; i++) {
LocalVariableTable_attribute.Entry entry = lvt.local_variable_table[i];
put(entry.start_pc, entry);
put(entry.start_pc + entry.length, entry);
}
}
Aggregations