< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/util/ASMifier.java

Print this page




 839         buf.append(", ");
 840         appendConstant(desc);
 841         buf.append(", ");
 842         appendConstant(signature);
 843         buf.append(", ");
 844         appendLabel(start);
 845         buf.append(", ");
 846         appendLabel(end);
 847         buf.append(", ").append(index).append(");\n");
 848         text.add(buf.toString());
 849     }
 850 
 851     @Override
 852     public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath,
 853             Label[] start, Label[] end, int[] index, String desc,
 854             boolean visible) {
 855         buf.setLength(0);
 856         buf.append("{\n").append("av0 = ").append(name)
 857                 .append(".visitLocalVariableAnnotation(");
 858         buf.append(typeRef);



 859         buf.append(", TypePath.fromString(\"").append(typePath).append("\"), ");

 860         buf.append("new Label[] {");
 861         for (int i = 0; i < start.length; ++i) {
 862             buf.append(i == 0 ? " " : ", ");
 863             appendLabel(start[i]);
 864         }
 865         buf.append(" }, new Label[] {");
 866         for (int i = 0; i < end.length; ++i) {
 867             buf.append(i == 0 ? " " : ", ");
 868             appendLabel(end[i]);
 869         }
 870         buf.append(" }, new int[] {");
 871         for (int i = 0; i < index.length; ++i) {
 872             buf.append(i == 0 ? " " : ", ").append(index[i]);
 873         }
 874         buf.append(" }, ");
 875         appendConstant(desc);
 876         buf.append(", ").append(visible).append(");\n");
 877         text.add(buf.toString());
 878         ASMifier a = createASMifier("av", 0);
 879         text.add(a.getText());


 917         buf.append(", ").append(visible).append(");\n");
 918         text.add(buf.toString());
 919         ASMifier a = createASMifier("av", 0);
 920         text.add(a.getText());
 921         text.add("}\n");
 922         return a;
 923     }
 924 
 925     public ASMifier visitTypeAnnotation(final int typeRef,
 926             final TypePath typePath, final String desc, final boolean visible) {
 927         return visitTypeAnnotation("visitTypeAnnotation", typeRef, typePath,
 928                 desc, visible);
 929     }
 930 
 931     public ASMifier visitTypeAnnotation(final String method, final int typeRef,
 932             final TypePath typePath, final String desc, final boolean visible) {
 933         buf.setLength(0);
 934         buf.append("{\n").append("av0 = ").append(name).append(".")
 935                 .append(method).append("(");
 936         buf.append(typeRef);



 937         buf.append(", TypePath.fromString(\"").append(typePath).append("\"), ");

 938         appendConstant(desc);
 939         buf.append(", ").append(visible).append(");\n");
 940         text.add(buf.toString());
 941         ASMifier a = createASMifier("av", 0);
 942         text.add(a.getText());
 943         text.add("}\n");
 944         return a;
 945     }
 946 
 947     public void visitAttribute(final Attribute attr) {
 948         buf.setLength(0);
 949         buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
 950         if (attr instanceof ASMifiable) {
 951             if (labelNames == null) {
 952                 labelNames = new HashMap<Label, String>();
 953             }
 954             buf.append("{\n");
 955             ((ASMifiable) attr).asmify(buf, "attr", labelNames);
 956             buf.append(name).append(".visitAttribute(attr);\n");
 957             buf.append("}\n");




 839         buf.append(", ");
 840         appendConstant(desc);
 841         buf.append(", ");
 842         appendConstant(signature);
 843         buf.append(", ");
 844         appendLabel(start);
 845         buf.append(", ");
 846         appendLabel(end);
 847         buf.append(", ").append(index).append(");\n");
 848         text.add(buf.toString());
 849     }
 850 
 851     @Override
 852     public Printer visitLocalVariableAnnotation(int typeRef, TypePath typePath,
 853             Label[] start, Label[] end, int[] index, String desc,
 854             boolean visible) {
 855         buf.setLength(0);
 856         buf.append("{\n").append("av0 = ").append(name)
 857                 .append(".visitLocalVariableAnnotation(");
 858         buf.append(typeRef);
 859         if (typePath == null) {
 860             buf.append(", null, ");
 861         } else {
 862             buf.append(", TypePath.fromString(\"").append(typePath).append("\"), ");
 863         }
 864         buf.append("new Label[] {");
 865         for (int i = 0; i < start.length; ++i) {
 866             buf.append(i == 0 ? " " : ", ");
 867             appendLabel(start[i]);
 868         }
 869         buf.append(" }, new Label[] {");
 870         for (int i = 0; i < end.length; ++i) {
 871             buf.append(i == 0 ? " " : ", ");
 872             appendLabel(end[i]);
 873         }
 874         buf.append(" }, new int[] {");
 875         for (int i = 0; i < index.length; ++i) {
 876             buf.append(i == 0 ? " " : ", ").append(index[i]);
 877         }
 878         buf.append(" }, ");
 879         appendConstant(desc);
 880         buf.append(", ").append(visible).append(");\n");
 881         text.add(buf.toString());
 882         ASMifier a = createASMifier("av", 0);
 883         text.add(a.getText());


 921         buf.append(", ").append(visible).append(");\n");
 922         text.add(buf.toString());
 923         ASMifier a = createASMifier("av", 0);
 924         text.add(a.getText());
 925         text.add("}\n");
 926         return a;
 927     }
 928 
 929     public ASMifier visitTypeAnnotation(final int typeRef,
 930             final TypePath typePath, final String desc, final boolean visible) {
 931         return visitTypeAnnotation("visitTypeAnnotation", typeRef, typePath,
 932                 desc, visible);
 933     }
 934 
 935     public ASMifier visitTypeAnnotation(final String method, final int typeRef,
 936             final TypePath typePath, final String desc, final boolean visible) {
 937         buf.setLength(0);
 938         buf.append("{\n").append("av0 = ").append(name).append(".")
 939                 .append(method).append("(");
 940         buf.append(typeRef);
 941         if (typePath == null) {
 942             buf.append(", null, ");
 943         } else {
 944             buf.append(", TypePath.fromString(\"").append(typePath).append("\"), ");
 945         }
 946         appendConstant(desc);
 947         buf.append(", ").append(visible).append(");\n");
 948         text.add(buf.toString());
 949         ASMifier a = createASMifier("av", 0);
 950         text.add(a.getText());
 951         text.add("}\n");
 952         return a;
 953     }
 954 
 955     public void visitAttribute(final Attribute attr) {
 956         buf.setLength(0);
 957         buf.append("// ATTRIBUTE ").append(attr.type).append('\n');
 958         if (attr instanceof ASMifiable) {
 959             if (labelNames == null) {
 960                 labelNames = new HashMap<Label, String>();
 961             }
 962             buf.append("{\n");
 963             ((ASMifiable) attr).asmify(buf, "attr", labelNames);
 964             buf.append(name).append(".visitAttribute(attr);\n");
 965             buf.append("}\n");


< prev index next >