3-rd round RFR (S) 8008678: JSR 292: constant pool reconstitution must support pseudo strings

Remi Forax forax at univ-mlv.fr
Sat Jan 17 11:12:31 UTC 2015

On 01/17/2015 12:32 AM, John Rose wrote:
> On Jan 16, 2015, at 3:03 PM, Coleen Phillimore <coleen.phillimore at oracle.com> wrote:
>> I was sort of wondering about this along the same lines.  You're setting the second bit, right? :)
> That sounds good, much better than the string prefix hack.
> Parsing the string would introduce too much coupling between the JVM and random details of the JDK.
> I also suggested to Serguei that redefinition of patched classes is not going to happen, since they are not user-visible.  So all of the "EMCP" logic can punt on pseudo-strings, one way or another, if it needs to.

It's doing to happen if some random guy simultaneously uses 
unsafe.defineAnonymousClass for implementing a dynamic language and use 
instrumentation to simulate a kind of debugger like API.

> BTW, since patched classes are always anonymous classes, you can't even get to them, unless you dig them out some private place like a lambda form.

patched classes and anonymous classes are currently the same thing, but 
having the patched class mechanism with a classical classloader will be 
useful for every dynamic languages like Nashorn that needs to store 
deoptimization data along the generated bytecodes.
I believe, but I've not spend much time to think on that, that such 
mechanism is not unsafe and can be added in java.lang.ClassLoader.

> Reconstitution is also a lost cause, since the patches will be dropped, but I see how that might be something you might possibly run into, as a stress test or some sort of debugger display.
> — John


More information about the hotspot-dev mailing list