public void trace(StringBuffer buf, Map labelNames) { List frames = getFrames(); buf.append("[\n"); for (int i = 0; i < frames.size(); i++) { StackMapFrame f = (StackMapFrame) frames.get(i); buf.append(" Frame:"); appendLabel(buf, labelNames, f.label); buf.append(" locals["); traceTypeInfo(buf, labelNames, f.locals); buf.append("]"); buf.append(" stack["); traceTypeInfo(buf, labelNames, f.stack); buf.append("]\n"); } buf.append(" ] length:").append(len).append("\n"); }
void asmify( StackMapFrame f, StringBuffer buf, String varName, Map labelNames) { declareLabel(buf, labelNames, f.label); buf.append("{\n"); buf.append("StackMapFrame ") .append(varName) .append(" = new StackMapFrame();\n"); buf.append(varName) .append(".label = ") .append(labelNames.get(f.label)) .append(";\n"); asmifyTypeInfo(buf, varName, labelNames, f.locals, "locals"); asmifyTypeInfo(buf, varName, labelNames, f.stack, "stack"); buf.append("cvAttr.frames.add(").append(varName).append(");\n"); buf.append("}\n"); }
public void asmify(StringBuffer buf, String varName, Map labelNames) { List frames = getFrames(); if (frames.size() == 0) { buf.append("List frames = Collections.EMPTY_LIST;\n"); } else { buf.append("List frames = new ArrayList();\n"); for (int i = 0; i < frames.size(); i++) { buf.append("{\n"); StackMapFrame f = (StackMapFrame) frames.get(i); declareLabel(buf, labelNames, f.label); String frameVar = varName + "frame" + i; asmifyTypeInfo(buf, frameVar, labelNames, f.locals, "locals"); asmifyTypeInfo(buf, frameVar, labelNames, f.stack, "stack"); buf.append("StackMapFrame ") .append(frameVar) .append(" = new StackMapFrame(") .append(labelNames.get(f.label)) .append(", locals, stack);\n"); buf.append("frames.add(").append(frameVar).append(");\n"); buf.append("}\n"); } } buf.append("StackMapTableAttribute ").append(varName); buf.append(" = new StackMapTableAttribute(frames);\n"); }
public void asmify(StringBuffer buf, String varName, Map labelNames) { List frames = getFrames(); buf.append("{\n"); buf.append("StackMapAttribute ").append(varName).append("Attr"); buf.append(" = new StackMapAttribute();\n"); if (frames.size() > 0) { for (int i = 0; i < frames.size(); i++) { asmify((StackMapFrame) frames.get(i), buf, varName + "frame" + i, labelNames); } } buf.append(varName).append(".visitAttribute(").append(varName); buf.append("Attr);\n}\n"); }