(original) (raw)

On Feb 20, 2013, at 10:20 AM, Coleen Phillimore <coleen.phillimore@oracle.com> wrote:

Summary: Add JVM\_CONSTANT\_PseudoString in place of JVM\_CONSTANT\_Object and use this tag to distinguish patched pseudo strings. The original string is retained if it was present.

This is reasonable; it is a good cleanup.  If you can propose a name better than "PseudoString" I'm all ears.

Consider getting rid of set\_has\_pseudo\_string.  That flag was present (IIRC) only to tell the GC that there might be non-perm oops in the constant pool.  Do we still need that?

I'm not sure how class file reconstitution for pseudo-strings is going to work, but I thought it was prudent to leave the Symbol\* in the slot for the patched string.

If you really wanted to reconstitute a class file for an anonymous class, and if that class has oop patching (pseudo-strings), you would need either to (a) reconstitute the patches array handed to Unsafe.defineAnonymousClass, or (b) accept whatever odd strings were there first, as an approximation.  The "odd strings" are totally insignificant, and are typically something like "CONSTANT\_PLACEHOLDER\_42" (see InvokerBytecodeGenerator::constantPlaceholder).

� John