Crash with invokeDynamic on MethodMissing attempt
Yehuda Katz
wycats at gmail.com
Mon May 18 18:57:14 PDT 2009
I've pretty much achieved everything I was trying to do last night:
http://gist.github.com/113717
I guess the next question is: how can I avoid needing to know the target
return value in invoke:
String invoke(DynamicTester tester, String extra) {
return target.<String>invoke(tester, name, extra);
}
Ideally, I'd like to be able to do something like:
Object invoke(DynamicTester tester, Object... objects) {
return target.invoke(tester, name, objects);
}
Where the original method could be methodNotFound(name, String... name) or
whatever.
Again, I'm relatively new to all this, so I'm pretty sure what I want to do
is either a big no-no or a no-brainer.
-- Yehuda
On Mon, May 18, 2009 at 5:54 PM, John Rose <John.Rose at sun.com> wrote:
> Excellent, thanks. Will try it ASAP (when not working on my J1 slides
> which are due today).
>
> -- John (on my iPhone)
>
> On May 18, 2009, at 4:29 PM, Charles Oliver Nutter <charles.nutter at sun.com
> > wrote:
>
> > 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
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
>
--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20090518/e7473952/attachment.html
More information about the mlvm-dev
mailing list