< prev index next >

src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java

Print this page

 905         if (sym.kind != TYP) return;
 906         ClassSymbol csym = (ClassSymbol)sym;
 907         if (csym.owner.kind != PCK) {
 908             seen.add(csym);
 909         }
 910         if (csym.members() != null) {
 911             for (Symbol s : sym.members().getSymbols()) {
 912                 listNested(s, seen);
 913             }
 914         }
 915         if (csym.trans_local != null) {
 916             for (Symbol s : csym.trans_local) {
 917                 listNested(s, seen);
 918             }
 919         }
 920     }
 921 
 922     /** Write "PermittedSubclasses" attribute.
 923      */
 924     int writePermittedSubclassesIfNeeded(ClassSymbol csym) {
 925         if (csym.permitted.nonEmpty()) {
 926             int alenIdx = writeAttr(names.PermittedSubclasses);
 927             databuf.appendChar(csym.permitted.size());
 928             for (Symbol c : csym.permitted) {
 929                 databuf.appendChar(poolWriter.putClass((ClassSymbol) c));
 930             }
 931             endAttr(alenIdx);
 932             return 1;
 933         }
 934         return 0;
 935     }
 936 
 937     /** Write "bootstrapMethods" attribute.
 938      */
 939     void writeBootstrapMethods() {
 940         int alenIdx = writeAttr(names.BootstrapMethods);
 941         int lastBootstrapMethods;
 942         do {
 943             lastBootstrapMethods = poolWriter.bootstrapMethods.size();
 944             for (BsmKey bsmKey : java.util.List.copyOf(poolWriter.bootstrapMethods.keySet())) {
 945                 for (LoadableConstant arg : bsmKey.staticArgs) {
 946                     poolWriter.putConstant(arg);
 947                 }
 948             }
 949         } while (lastBootstrapMethods < poolWriter.bootstrapMethods.size());

 905         if (sym.kind != TYP) return;
 906         ClassSymbol csym = (ClassSymbol)sym;
 907         if (csym.owner.kind != PCK) {
 908             seen.add(csym);
 909         }
 910         if (csym.members() != null) {
 911             for (Symbol s : sym.members().getSymbols()) {
 912                 listNested(s, seen);
 913             }
 914         }
 915         if (csym.trans_local != null) {
 916             for (Symbol s : csym.trans_local) {
 917                 listNested(s, seen);
 918             }
 919         }
 920     }
 921 
 922     /** Write "PermittedSubclasses" attribute.
 923      */
 924     int writePermittedSubclassesIfNeeded(ClassSymbol csym) {
 925         if (csym.getPermittedSubclasses().nonEmpty()) {
 926             int alenIdx = writeAttr(names.PermittedSubclasses);
 927             databuf.appendChar(csym.getPermittedSubclasses().size());
 928             for (Type t : csym.getPermittedSubclasses()) {
 929                 databuf.appendChar(poolWriter.putClass((ClassSymbol) t.tsym));
 930             }
 931             endAttr(alenIdx);
 932             return 1;
 933         }
 934         return 0;
 935     }
 936 
 937     /** Write "bootstrapMethods" attribute.
 938      */
 939     void writeBootstrapMethods() {
 940         int alenIdx = writeAttr(names.BootstrapMethods);
 941         int lastBootstrapMethods;
 942         do {
 943             lastBootstrapMethods = poolWriter.bootstrapMethods.size();
 944             for (BsmKey bsmKey : java.util.List.copyOf(poolWriter.bootstrapMethods.keySet())) {
 945                 for (LoadableConstant arg : bsmKey.staticArgs) {
 946                     poolWriter.putConstant(arg);
 947                 }
 948             }
 949         } while (lastBootstrapMethods < poolWriter.bootstrapMethods.size());
< prev index next >