Crash from "recursive" method handle chain

Charles Oliver Nutter headius at headius.com
Wed Jul 27 02:50:14 PDT 2011


I'm getting back into invokedynamic stuff (in between
conferencing...whew!). Perf reports are coming soon, but in the
interim....

I was playing with implementing "loops" using the trick Ola showed me
of binding a call site in the chain and having it circle back to the
top. Fun, cute, etc.

https://gist.github.com/1109021

(might be interesting for cookbook?)

However I realized while implementing it that it kinda blurs the lines
between recursive and iterative. Logically, the rebound call site
should act like a backward branch to another iteration. That's what
I'd expect to happen if everything compiles and inlines together; the
MH chain would see that the call site is bound to an
already-encountered handle higher up in the chain and treat it as a
branching operation.

It does seem to work fine for low values, but for high values I got a
crash (on openjdk-osx-build probably equivalent to b146 or *maybe*
b147): "Illegal instruction"

Here's the full session. What sayeth ye all?

https://gist.github.com/1109026

I've pushed the code here:

https://github.com/headius/indy-examples

- Charlie


More information about the mlvm-dev mailing list