[vmkit-commits] Breaking change for openjdk

Nicolas Geoffray nicolas.geoffray at gmail.com
Fri Dec 2 09:54:21 PST 2011


Hi Will,

On Thu, Dec 1, 2011 at 11:30 PM, Will Dietz <wdietz2 at illinois.edu> wrote:

> Thanks for the heads-up and description.
>
> Looking at classpath's implementation (String.java, VMString.java) I
> don't see why we couldn't do exactly the same thing for the OpenJDK
> port.
>
> Only issue is that there is no equivalent of VMString.java in OpenJDK,
> perhaps we could just pull it in (the file I mean) and use it in both
> ports?  That would be the simplest and fine with me.
>
> An alternative is to basically duplicate the equivalent code into
> VMKit somewhere?  The code would create a WeakHashMap early on and
> would have a method that does exactly what VMString::intern does in
> VMString.java, which would be straightforward.
>

Yes, I believe that's possible. Depends if openjdk needs fancy things when
creating a WeakHashMap.

>
> Engineering details aside your change sounds fine and if the above
> ideas don't immediately sound good then just do what you were going to
> do and I'll sort out the OpenJDK version when I get a chance :).
>

Great! I'll submit the change then, and let you deal with the breakage :)

>
> In related news, last night I successfully got eclipse running! :D
> Was a nice milestone, and wanted to share.  Still can't run all the
> dacapo codes yet, though :).
>

This is great news! Does that mean precompilation and GC work on the
openjdk port? That's awesome. Can't wait to try it out!

Nicolas


> ~Will
>
> On Thu, Dec 1, 2011 at 3:15 PM, Nicolas Geoffray
> <nicolas.geoffray at gmail.com> wrote:
> > 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/20111202/a69514b6/attachment.html>


More information about the vmkit-commits mailing list