jruby build/run instructions
John Rose
John.Rose at Sun.COM
Tue Jun 2 15:07:13 PDT 2009
--------
cat RUBY-ARGS.sh
echo \
-Xbootclasspath/p:$HOME/Projects/meth/dist/meth.jar \
-Xbootclasspath/a:$HOME/Projects/jruby-main/lib/jruby.jar \
-XX:+EnableInvokeDynamic \
-Djruby.compile.invokedynamic=true \
-Xbootclasspath/a:$HOME/Projects/jruby-main/lib/jruby.jar \
-Djruby.home=$HOME/Projects/jruby-main \
"$*" \
org.jruby.Main
--------
cat script.rb
def foo(a); end; a = 1; while a < 1_000_000; foo(a); a += 1; end
print "Hello, world!\n"
--------
$JAVA7X_HOME/bin/java -Xint $(sh ./RUBY-ARGS.sh) script.rb
...
--------
This assumes that the jruby-main project is pulled and built, and also
the meth project is pulled and built:
hg clone http://hg.openjdk.java.net/mlvm/mlvm (subdir netbeans/meth)
browse: http://hg.openjdk.java.net/mlvm/mlvm/file/tip/netbeans/meth/
Here's the git I'm using on MacOS:
http://code.google.com/p/git-osx-installer/
--------
which git; git --version
/usr/local/git/bin/git
git version 1.6.1.3
--------
ls -l ~/Downloads/git-1.6.1.3-intel-leopard.dmg
-rw-r--r--@ 1 jrose staff 5689974 Mar 23 16:40 /Users/jrose/
Downloads/git-1.6.1.3-intel-leopard.dmg
--------
Charlie gave more details a couple weeks ago; see below.
-- John
From: Charles Oliver Nutter <charles.nutter at sun.com>
Date: May 18, 2009 4:29:13 PM PDT
To: Da Vinci Machine Project <mlvm-dev at openjdk.java.net>
Subject: Re: Crash with invokeDynamic on MethodMissing attempt
Reply-To: Da Vinci Machine Project <mlvm-dev at openjdk.java.net>
Here you go! The details of getting it to run under mlvm are up to you,
but jruby accepts options like -J-XX:+EnableInvokeDynamic, etc.
git clone git://kenai.com/jruby~main jruby
cd jruby
git co -b invokedynamic origin/invokedynamic
ant clean jar (with MLVM as JAVA_HOME)
bin/jruby <important flags here> -e "code here"
-or-
bin/jruby <important flags here> script.rb
Where important flags are:
--server (-server flag to JVM, if you want it)
-J-XX:+Enable{InvokeDynamic,MethodHandles}
-J-Djruby.compile.invokedynamic=true
Not a whole lot of logging/debugging in place at the moment, but if you
also pass --bytecode to JRuby it will dump out the bytecode for the
target script rather than run it. If it's wiring up right you'll see
INVOKEDYNAMIC in there.
- Charlie
John Rose wrote:
My first use of git was a couple days ago, to pull jruby from kenai.
So I'm a git noob. (Too bad about ruby & mercurial.)
That said, can I have a recipe (script) for pulling, building your
hacked version of jruby, and then for running your test case(s)?
(From NetBeans, if possible, so I can dive into the JRuby code and
start debugging?)
Thanks; this is getting interesting!
-- John
On May 18, 2009, at 4:01 PM, Charles Oliver Nutter wrote:
I'm also seeing crashes for several scenarios. Like this loop works:
a = 1; while a < 1_000_000; a += 1; end
But these two crash the JVM:
a = 1.0; while a < 1_000_000.0; foo(a); a += 1.0; end
def foo(a); end; a = 1; while a < 1_000_000; foo(a); a += 1; end
A simple fib bench also crashed. I've attached a dump from the "foo"
case above, and I can provide a jruby dist to reproduce if you like.
It tends to stymie further experimentation :) (no pressure, I know
this stuff has just recently started to JIT).
_______________________________________________
mlvm-dev mailing list
mlvm-dev at openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
_______________________________________________
mlvm-dev mailing list
mlvm-dev at openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
More information about the mlvm-dev
mailing list