Target build for MLVM class path changes?
john.r.rose at oracle.com
Tue Mar 1 15:19:05 PST 2011
On Mar 1, 2011, at 11:47 AM, Mark Roos wrote:
> Subject: Target build for MLVM class path changes?
> Not critical but I would like to plan my tasks around it.
This is a timely question. The short answer is that the Public Review API should be available in b132 this week in the java.dyn package, and should be available in the (final, as-specified) java.lang.invoke package by approximately b135 or b136. The there will be transitional compatibility modes; read on to see what this means.
Christian and I have been working on the coordinated JVM and JDK changes for moving to the current Public Review API. These changes are almost ready to begin feeding into the JDK7 release pipeline. We have chosen to decouple the JVM and JDK changes (for multiple reasons), so there will be versions of the JVM which supports both old and new versions of the JDK (relative to the JSR 292 API). These JVM versions will probably come out of the release pipeline before the JDK changes, although simultaneous release is possible.
The mlvm patch repository has the changes queued up in several phases, and you may have seen my request for review of the JDK changes (2/27 email).
The main tricky bit is arranging for the JVM to support both package names, so that individual users can choose when to move from java.dyn to java.lang.invoke. The JVM will not have a switch to select the package, but it auto-detects the contents of rt.jar (and the boot class path). This means that a suitable -Xbootclasspath option will configure the JVM to support the desired package.
For this purpose, I have posted minimal JARs here:
http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm-old/dist-b132/ (works with current released JVM)
http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm-old/dist-impl-6839872/ (java.dyn support, upcoming JVM)
http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm-old/dist-rename-7012648/ (java.lang.invoke support, upcoming JVM)
All of these support the Public Review draft API, except that the first two stay in the old package java.dyn.
By "upcoming JVM" I mean the one which you can build from the mlvm patch queue, but which is not yet available in JDK7.
The upcoming JVM will eventually (before JDK7 FCS!) delete the transitional support for the old package. The mlvm patch for this already exists in draft form:
At that point, the bootclasspath hack will fail to elicit JVM support for the java.dyn API.
To test your software for to see if it is ready for that Armageddon, use this JVM flag: -XX:-AllowTransitionalJSR292 . It disables the auto-detection, and makes the JVM refuse to recognize anything but the newest API. Currently, that flag disables support for the very old Early Draft Review APIs, including the parts based on java.dyn.Linkage. If you don't use CONSTANT_InvokeDynamic (= 18 not 17) and the BootstrapMethods attribute for your invokedynamic instructions, it's time to change.
> I am using the late Feb build by Stephen and it is not compatible with b131 (exception changes )
> BTW its working great
That's good to know. To begin upgrading, you might try putting the "dist-b132" JAR file on your boot class path now. It should allow you to work with the updated API.
Or, you could wait: By the end of the week, b132 will probably be out, and JDK7 will support the Public Review API (minus the package change).
For Mac users of JSR 292, the bsd-port is about to fast-forward to b130, including a crucial fix to 7010180; at that point the "dist-b132" JAR file should be useful.
More information about the mlvm-dev