trouble building mlvm
Paul Phillips
paulp at improving.org
Tue Dec 16 15:21:52 PST 2008
On Tue, Dec 16, 2008 at 05:37:35PM +0100, Iulian Dragos wrote:
> To clarify this point: doing an (what I think) exhaustive search
> through all jars in the output directory yields no CallSite.class, or
> anything in the java.dyn package. Those source files exist in
> sources/jdk.
You are quite right, the whole java.dyn package wasn't being built. I will guess that when the mlvm
patches were last tested, the make system built whatever files it found - but now it only builds what is
specifically enumerated. I mimicked another java package to get it built, as shown in this patch:
http://www.improving.org/scala/openjdk.diff
and (along with all the other patch fiddling) I'm almost sort of there:
export JAVA_HOME=/soft/lang/java/davinci/sources/build/bsd-i586/j2sdk-image
export JAVA_OPTS="-verbose -Xbootclasspath/a:$JAVA_HOME/jre/lib/rt.jar -XX:+{InvokeDynamic,MethodHandles}"
export PATH=$JAVA_HOME/bin:$PATH
[paulp at jon demo (exp)]$ scala
Welcome to Scala version 2.7.2.final (OpenJDK Server VM, Java 1.7.0-internal).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import java.dyn._
import java.dyn._
scala> class Foo { def bar(s: String): Unit = { } }
defined class Foo
scala> val fooType = MethodType.make(classOf[Unit], Array[Class[_]](classOf[String]), false)
fooType: java.dyn.MethodType = (java.lang.String)void
scala> val fooHandle = MethodHandles.findVirtual(classOf[Foo], "bar", fooType)
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGBUS (0xa) at pc=0x01366b0f, pid=49241, tid=2953121792
#
# Java VM: OpenJDK Server VM (14.0-b08 mixed mode bsd-x86 )
# Problematic frame:
# V [libjvm.dylib+0x366b0f]
#
Oops. Well, it's something. It's dying somewhere in MethodHandle::verify_method_type. I don't know if
I'm using it right -- I tried to run the demo from "invoke dynamic day" but it NPEs on me pretty fast and
I didn't have much faith it was up to date with current sources so I didn't investigate too hard.
[paulp at jon demo (exp)]$ $JAVACMD -Xbootclasspath/p:$JAVA_HOME/jre/lib/rt.jar -classpath /local/lib/java/junit.jar:. jdk.java.dyn.InvokeDynamicDemo count-1000
running ID demo
utf8Map: {fakeIdentity=identity, jdk/java/dyn/InvokeDynamicDemo$FakeDynamic=java/dyn/Dynamic, (Ljava/lang/Object;)Ljdk/java/dyn/InvokeDynamicDemo$FakeDynamic;=(Ljava/lang/Object;)Ljava/lang/Object;, FAKE_OPTIONS=[count-1000]}
Exception in thread "main" java.lang.NullPointerException
at java.dyn.ConstantPoolPatch$1.visitConstantValue(ConstantPoolPatch.java:178)
at java.dyn.ConstantPoolParser.parseConstantPool(ConstantPoolParser.java:208)
at java.dyn.ConstantPoolParser.parse(ConstantPoolParser.java:174)
at java.dyn.ConstantPoolPatch.putPatches(ConstantPoolPatch.java:168)
at jdk.java.dyn.InvokeDynamicDemo.run(InvokeDynamicDemo.java:146)
at jdk.java.dyn.InvokeDynamicDemo.main(InvokeDynamicDemo.java:179)
Let us keep soldiering onward, I can see the train at the end of the tunnel...
--
Paul Phillips | These are the climbs that apply men's soles.
Stickler |
Empiricist |
i pull his palp! |----------* http://www.improving.org/paulp/ *----------
More information about the mlvm-dev
mailing list