[vmkit-commits] Breaking change for openjdk

Nicolas Geoffray nicolas.geoffray at gmail.com
Thu Dec 1 13:15:43 PST 2011


Will,

I plan on submitting this patch that I know will break openjdk. Basically,
I'm changing the way we intern strings to call a Java method defined in the
classlib. For GNU Classpath, it's easy, it just calls VMString::intern. I
don't know if OpenJDK has a Java implementation that can be called
directly. Note that calling VMString::intern comes pretty early in the
game: the first time a string is created in J3, it will call it.

An easy fix for the openjdk port is to set JavaUpcalls::internString to
NULL. The Jnjvm::constructString method will then not attempt to intern the
string and call a Java  method. Of course that is not spec compliant,
because some strings must be interned, but at least it should not crash on
you.

The rationale behind that change is that the current implementation did not
really work and was adding unneeded complexity on top of vmkit (more or
less adding C++ weak references). It was also storing Java objects into a
std::map, and I'd like to avoid that.

Will, let me know if the change and my intermediate fix proposal is ok with
you.

Cheers,
Nicolas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20111201/1e863299/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: intern.patch
Type: text/x-patch
Size: 13921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20111201/1e863299/attachment.bin>


More information about the vmkit-commits mailing list