Jigsaw classpath mode support
Mandy Chung
mandy.chung at oracle.com
Wed Aug 15 15:04:05 PDT 2012
On 8/15/2012 11:05 AM, Alan Bateman wrote:
> On 07/08/2012 18:47, Mandy Chung wrote:
>> I have implemented the "classpath mode" support running on
>> a module image.
>>
>> Webrev:
>> http://cr.openjdk.java.net/~mchung/jigsaw/webrevs/classpath-mode.00/
> I've finally got through all of this. Overall this is really good work.
>
Thanks for the review.
> A couple of comments/questions:
>
> In ClassPathContext when you distribute the contexts to each loader
> then it may be more efficient to iterate over each loader's module
> list and invoke the configuration's getContextForModuleName to get the
> Context directly. Then distribute the remaining to the loader for the
> boot class path. I suspect that could be more efficient than all the
> nested contains.
>
You are referring to L209-222, right? This is a good suggestion. I'll
revise it.
> One thing that I can't tell from the changes is the value of the
> sun.boot.module.classpath property. That might be clear once Karen
> publishes the hotspot changes. I ask because I can't tell if
> Package.SystemPackage.isPackageFromModule is right, meaning whether
> JVM_GetSystemPackage returns the value of sun.boot.module.classpath
> for packages in the system modules.
>
Yes, JVM_GetSystemPackage will return the value of
sun.boot.module.classpath for packages in the system modules. It's a
simple way to tag a package in the system module.
> In Launcher. ExtClassLoader there is code to split the extension
> directory into the paths that come before and after the default
> location. I think I need help in understand why someof this is needed
> because if someone sets java.ext.dirs then it should be a complete
> override?
>
It's for searching native libraries from the module image or
user-specified ext dir. The ExtClassLoader overrides the findLibrary
method. The java.ext.dirs can be overridden in the command line; if
not set, the VM will set its value to the default ext dirs. In
addition, someone can set java.ext.dirs to include JAVA_HOME/lib/ext
plus other additional directory. If the default ext dir is inclued in
the java.ext.dirs, ExtClassLoader needs to locate the native library
from the module image and loads a native library from each directory
specified in the property value before and after the default.
> I agree with your idea in the mail to get this pushed and deal with
> any clean-up/comments in later changes, especially as the test results
> are good. The only thing is I assume it will need to go in with the
> HotSpot changes.
>
> In terms of clean-up then I think CleanPathContext should be more
> efficient. There are also a few things in the sun.misc.Launcher code
> but they aren't urgent for now.
>
I'll fix the ClassPathContext how it distributes the modules/contexts to
each loader. Let me know what other things you have in mind and I will
see if I should fix them together.
Thanks
Mandy
More information about the jigsaw-dev
mailing list