Shark: fix ldc(Class)
Andrew Haley
aph at redhat.com
Tue Jan 13 01:52:37 PST 2009
Gary Benson wrote:
> Andrew Haley wrote:
>> I've been trying to track down a mysterious bug in Shark for a
>> couple of weeks, and I finally got it. It turns out that there's
>> no code generated for ldc(Class). What fun!
>>
>> Oh well, I learned a lot... :-)
>
> Was it not hitting an Unimplemented() or similar?
It simply generated a read from the constant pool. The cpool entry
points to a classOopDesc, so code has to be generated to get from the
classOopDesc to the Class.
Looking at sharkConstantPool.cpp, I now see java_mirror() which does the
same thing as the code I added. I'll change my code to call that
function.
Incidentally, I think there has to me a memory barrier between reading
the tag and reading the constant pool entry. The c++ interpeter
does this by calling byte_at_acquire().
Andrew.
More information about the distro-pkg-dev
mailing list