< prev index next > src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/PoolWriter.java
Print this page
import java.io.IOException;
import java.io.OutputStream;
import java.util.ArrayDeque;
import java.util.HashMap;
+ import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
+ import java.util.Set;
import static com.sun.tools.javac.code.Kinds.Kind.TYP;
import static com.sun.tools.javac.code.TypeTag.ARRAY;
import static com.sun.tools.javac.code.TypeTag.CLASS;
import static com.sun.tools.javac.jvm.ClassFile.CONSTANT_Class;
final SharedSignatureGenerator signatureGen;
/** The inner classes to be written, as an ordered set (enclosing first). */
LinkedHashSet<ClassSymbol> innerClasses = new LinkedHashSet<>();
+ Set<Symbol> loadableDescriptors = new HashSet<>();
+
/** The list of entries in the BootstrapMethods attribute. */
Map<BsmKey, Integer> bootstrapMethods = new LinkedHashMap<>();
public PoolWriter(Types types, Names names) {
this.types = types;
enterInner(c.owner.enclClass());
innerClasses.add(c);
}
}
+ /** Enter a value class into the `loadableDescriptorsClasses' set.
+ */
+ void enterLoadableDescriptorsClass(Symbol c) {
+ if (c.type.isCompound()) {
+ throw new AssertionError("Unexpected intersection type: " + c.type);
+ }
+ c.complete();
+ loadableDescriptors.add(c);
+ }
+
/**
* Create a new Utf8 entry representing a descriptor for given (member) symbol.
*/
private Type descriptorType(Symbol s) {
return s.kind == Kind.MTH ? s.externalType(types) : s.erasure(types);
return signatureGen.toName();
}
void reset() {
innerClasses.clear();
+ loadableDescriptors.clear();
bootstrapMethods.clear();
pool.reset();
}
}
< prev index next >