< prev index next >

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

Print this page

        

*** 31,40 **** --- 31,41 ---- import com.sun.tools.javac.code.Symbol.DynamicMethodSymbol; import com.sun.tools.javac.code.Symbol.MethodHandleSymbol; import com.sun.tools.javac.code.Symbol.ModuleSymbol; import com.sun.tools.javac.code.Symbol.PackageSymbol; import com.sun.tools.javac.code.Type; + import com.sun.tools.javac.code.Type.ConstantPoolQType; import com.sun.tools.javac.code.Types; import com.sun.tools.javac.jvm.ClassWriter.PoolOverflow; import com.sun.tools.javac.jvm.ClassWriter.StringOverflow; import com.sun.tools.javac.jvm.PoolConstant.LoadableConstant; import com.sun.tools.javac.jvm.PoolConstant.LoadableConstant.BasicConstant;
*** 117,126 **** --- 118,135 ---- int putClass(Type t) { return pool.writeIfNeeded(types.erasure(t)); } /** + * Puts a type into the pool and return its index. The type could be either a class, a type variable + * or an array type. + */ + int putClass(ConstantPoolQType t) { + return pool.writeIfNeeded(t); + } + + /** * Puts a member reference into the constant pool. Valid members are either field or method symbols. */ int putMember(Symbol s) { return pool.writeIfNeeded(s); }
*** 360,373 **** void writeConstant(PoolConstant c) { int tag = c.poolTag(); switch (tag) { case ClassFile.CONSTANT_Class: { ! Type ct = (Type)c; Name name = ct.hasTag(ARRAY) ? typeSig(ct) : ! names.fromUtf(externalize(ct.tsym.flatName())); poolbuf.appendByte(tag); poolbuf.appendChar(putName(name)); if (ct.hasTag(CLASS)) { enterInner((ClassSymbol)ct.tsym); } --- 369,382 ---- void writeConstant(PoolConstant c) { int tag = c.poolTag(); switch (tag) { case ClassFile.CONSTANT_Class: { ! Type ct = c instanceof ConstantPoolQType ? ((ConstantPoolQType)c).type : (Type)c; Name name = ct.hasTag(ARRAY) ? typeSig(ct) : ! c instanceof ConstantPoolQType ? names.fromString("Q" + new String(externalize(ct.tsym.flatName())) + ";") : names.fromUtf(externalize(ct.tsym.flatName())); poolbuf.appendByte(tag); poolbuf.appendChar(putName(name)); if (ct.hasTag(CLASS)) { enterInner((ClassSymbol)ct.tsym); }
< prev index next >