Hi,
I have made some progress:
wizziewol-ln:src lov080$ $b/javac -source 1.7 -bootclasspath $m/rt.jar
-g -Xlint invokedynamicvirgin/Hello.java
Works - hurray! You need both -source 1.7 and -bootclasspath $m/rt.jar
(-g and -Xlint aren't needed). Presumably this is a bug in the 1.7
compiler that doesn't set the defaults properly. Same result with both
Ben and Attila builds. However I still have a problem with running the
code, e.g. with Attila's build:
wizziewol-ln:src lov080$ $b/java -showversion -ea -XX:
+EnableMethodHandles invokedynamicvirgin.Hello
openjdk version "1.7.0-internal"
OpenJDK Runtime Environment (build 1.7.0-internal-
aszegedi_2009_04_19_15_49-b00)
OpenJDK Server VM (build 15.0-b02, mixed mode)
Hello, world (from a statically linked call site)
Hello, world
Exception in thread "main" java.lang.IncompatibleClassChangeError
at invokedynamicvirgin.Hello.main(Hello.java:30)
Identical result on both builds. The code in question is:
public static void main( String... av ) {
if ( av.length == 0 ) { av = new String[] { "world" }; }
greeter( av[ 0 ] + " (from a statically linked call site)" );
for ( String whom : av ) {
greeter.<void>invoke( whom ); // strongly typed direct call
// previous line generates invokevirtual MethodHandle.invoke
(String)void
Dynamic x = whom;
x.hail(); // weakly typed invokedynamic
// previous line generates invokedynamic
// MethodHandle.invoke(Dynamic)Dynamic
}
}
And line 30 is the x.hail() line. The code is Simple Example from:
http://wikis.sun.com/display/mlvm/ProjectCoinProposal
Can you guys run this code, if so, what are your command line options?
Thanks,
-- Howard.
On Apr 23, 9:43 am, hlovatt <[email protected]> wrote:
> Hi Ben,
>
> I get exactly the same result with your build:
>
> wizziewol-ln:src lov080$ echo $JAVA_HOME
> /System/Library/Frameworks/JavaVM.framework/Versions/1.7.20090410/
> Home/
> wizziewol-ln:src lov080$ echo $a/System/Library/Frameworks/
> JavaVM.framework/Versions/1.7.20090410/Home/bin/
> wizziewol-ln:src lov080$ echo $l/System/Library/Frameworks/
> JavaVM.framework/Versions/1.7.20090410/Home/jre/lib/
> wizziewol-ln:src lov080$ $a/jar tf $l/rt.jar | grep java/dynjava/dyn/
> AnonymousClassLoader.class
> java/dyn/CallSite.class
> java/dyn/ConstantPoolParser.class
> java/dyn/ConstantPoolPatch$1.class
> java/dyn/ConstantPoolPatch$2.class
> java/dyn/ConstantPoolPatch.class
> java/dyn/ConstantPoolVisitor.class
> java/dyn/Dynamic.class
> java/dyn/InvalidConstantPoolFormatException.class
> java/dyn/InvokeDynamicBootstrapError.class
> java/dyn/Linkage.class
> java/dyn/LinkagePermission.class
> java/dyn/MethodHandle.class
> java/dyn/MethodHandles.class
> java/dyn/MethodType.class
> java/dyn/MethodTypeForm.class
> java/dyn/NoAccessException.class
> java/dyn/WrongMethodTypeException.class
> wizziewol-ln:src lov080$ $a/javac -version -cp $l/rt.jar:.
> invokedynamicvirgin/Hello.java
> javac 1.7.0-internal
> invokedynamicvirgin/Hello.java:3: package java.dyn does not exist
> import java.dyn.*;
> ^
>
> Thanks for the posting of your version, I have know idea what is going
> on :(
>
> -- Howard.
>
> On Apr 22, 8:28 pm, Ben Evans <[email protected]>
> wrote:
>
> > I've got an alternative binary build available - it's the codebase as
> > of 2009-04-10. There's a download link available from my
> > blog:http://boxcatjunction.blogspot.com
>
> > I've been using it as my primary JVM without any problems (including
> > the invdyn features) for the last 10 days or so.
>
> > Sent from my iPhone
>
> > On 22 Apr 2009, at 10:28, hlovatt <[email protected]> wrote:
>
> > > Even if I explicitly include rt.jar then I get the same:
>
> > > wizziewol-ln:src lov080$ echo $a ; echo $l ; ($a/jar tf $l/rt.jar |
> > > grep java/dyn) ; $a/javac -version -cp $l/rt.jar:.
> > > invokedynamicvirgin/
> > > Hello.java
> > > /System/Library/Frameworks/JavaVM.framework/Versions/1.7.777/Home/bin
> > > /System/Library/Frameworks/JavaVM.framework/Versions/1.7.777/Home/jre/
> > > lib
> > > java/dyn/AnonymousClassLoader.class
> > > java/dyn/CallSite.class
> > > java/dyn/ConstantPoolParser.class
> > > java/dyn/ConstantPoolPatch$1.class
> > > java/dyn/ConstantPoolPatch$2.class
> > > java/dyn/ConstantPoolPatch.class
> > > java/dyn/ConstantPoolVisitor.class
> > > java/dyn/Dynamic.class
> > > java/dyn/InvalidConstantPoolFormatException.class
> > > java/dyn/InvokeDynamicBootstrapError.class
> > > java/dyn/Linkage.class
> > > java/dyn/LinkagePermission.class
> > > java/dyn/MethodHandle.class
> > > java/dyn/MethodHandles.class
> > > java/dyn/MethodType.class
> > > java/dyn/MethodTypeForm.class
> > > java/dyn/NoAccessException.class
> > > java/dyn/WrongMethodTypeException.class
> > > javac 1.7.0-internal
> > > invokedynamicvirgin/Hello.java:3: package java.dyn does not exist
> > > import java.dyn.*;
> > > ^
>
> > > On Apr 22, 6:55 pm, hlovatt <[email protected]> wrote:
> > >> JAVA_HOME wasn't set, but if I do set it then nothing changes. I have
> > >> tried pointing JAVA_HOME to the top level directory, to the jre, and
> > >> jre/lib. Don't know what is going wrong!
>
> > >> On Apr 22, 6:27 pm, Attila Szegedi <[email protected]> wrote:
>
> > >>> Hm... java.dyn. classes are definitely present in rt.jar. Are you
> > >>> sure
> > >>> your javac is getting classes from the rt.jar in jre/lib of the
> > >>> MLVM?
> > >>> Is your JAVA_HOME set to the MLVM directory (or its JRE?)
>
> > >>> Attila.
>
> > >>> On 2009.04.22., at 9:15, anon wrote:
>
> > >>>> Hi, thanks for building this it is very helpful since I use a Mac.
>
> > >>>> I am having trouble getting it to work though. It works fine for
> > >>>> none
> > >>>> Invoke Dynamic examples, e.g. HelloWorld, but when I try John
> > >>>> Rose's
> > >>>> simple example
> > >>>> from:http://wikis.sun.com/display/mlvm/ProjectCoinProposal
> > >>>> I get:
>
> > >>>> wizziewol-ln:src lov080$ $a/javac -version invokedynamicvirgin/
> > >>>> Hello.java
> > >>>> javac 1.7.0-internal
> > >>>> invokedynamicvirgin/Hello.java:3: package java.dyn does not exist
> > >>>> import java.dyn.*;
> > >>>> ^
> > >>>> ...
>
> > >>>> Almost certainly something I am doing wrong - can you help with my
> > >>>> mistake? Is there a command-line argument I need?
>
> > >>>> Thanks in advance for any help.
>
> > >>>> -- Howard.
>
> > >>>> On Apr 21, 5:23 am, Attila Szegedi <[email protected]> wrote:
> > >>>>> On Mon, Apr 20, 2009 at 9:18 PM, Thomas E Enebo
> > >>>>> <[email protected]> wrote:
>
> > >>>>>> You rock! Thanks...and now build them forever more for all of
> > >>>>>> us as
> > >>>>>> the changesets come in :)
>
> > >>>>> Every morning right between putting on the coffee and waking up
> > >>>>> the
> > >>>>> kids for school ;-)
>
> > >>>>> Attila.
>
> > >>>> On Apr 21, 5:23 am, Attila Szegedi <[email protected]> wrote:
> > >>>>> On Mon, Apr 20, 2009 at 9:18 PM, Thomas E Enebo
> > >>>>> <[email protected]> wrote:
>
> > >>>>>> You rock! Thanks...and now build them forever more for all of
> > >>>>>> us as
> > >>>>>> the changesets come in :)
>
> > >>>>> Every morning right between putting on the coffee and waking up
> > >>>>> the
> > >>>>> kids for school ;-)
>
> > >>>>> Attila.
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en
-~----------~----~----~----~------~----~------~--~---