On Jul 12, 2017, at 11:10 AM, Karen Kinnear <karen.kinn...@oracle.com> wrote: > > > And if I understand the proposal correctly, we are replacing constant pool > patching > with Lookup.getConstant() with a private Lookup, which uses an ldc of condy > underneath, > so essentially the BSM is filling in new types in the condy constant pool > entries. >
That's not quite right. The Lookup.getConstant almost certainly won't look in the constant pool. (It could but there are about ten cleaner ways to do it.) The trick is carrying a single pointer supplied by the user from the Lookup.defineClass call, through (or past) the VM class loading mechanisms, and into a place where Lookup.getConstant can find it. My preference would be an extra injected field in the java.lang.Class mirror for the loaded class, as if it were a static final field, but without the extra stuff that gives it a name. The type would *always* be java.lang.Object. — John