On 05/12/2015 03:47 PM, Andrew Haley wrote: > On 04/28/2015 09:00 PM, Dmitry Samersoff wrote: >> Thank you for the fix, I'll take a look at it > > Hi, > > Any thoughts? HSDB doesn't really do anything without this fix, and > there is no doubt that the bottom two bits of a Symbol address must be > masked out. > > The only problem I have is deciding where to do the masking. Doing in > when we create an instance of Symbol from an address always works, but > I'm not sure it's the right thing to do.
For what it's worth, this may be a better patch. It works just as well, and it is only applied to cpool entries. Andrew. diff -r f39a03c0ced3 agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java --- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java Tue May 12 16:14:34 2015 +0100 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java Tue May 12 16:23:00 2015 +0100 @@ -170,7 +170,7 @@ } public Symbol getSymbolAt(long index) { - return Symbol.create(getAddressAtRaw(index)); + return Symbol.create(getAddressAtRaw(index).andWithMask(~3)); } public int getIntAt(long index){