Spread problem with > 10 arguments
Charles Oliver Nutter
headius at headius.com
Fri Jul 3 16:00:25 PDT 2009
I seem to have stumbled onto a problem with some handles and >10 or
>11 arguments.
For this code:
System.out.println(target.type());
System.out.println(breakJump.type());
target = MethodHandles.catchException(target,
JumpException.BreakJump.class, breakJump);
This pair of method types works:
(org.jruby.runtime.callsite.CacheEntry,org.jruby.runtime.ThreadContext,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,java.lang.String,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.Block)org.jruby.runtime.builtin.IRubyObject
(org.jruby.exceptions.JumpException$BreakJump,org.jruby.runtime.callsite.CacheEntry,org.jruby.runtime.ThreadContext,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,java.lang.String,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.Block)org.jruby.runtime.builtin.IRubyObject
But this pair produces an error:
(org.jruby.runtime.callsite.CacheEntry,org.jruby.runtime.ThreadContext,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,java.lang.String,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.Block)org.jruby.runtime.builtin.IRubyObject
(org.jruby.exceptions.JumpException$BreakJump,org.jruby.runtime.callsite.CacheEntry,org.jruby.runtime.ThreadContext,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,java.lang.String,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.builtin.IRubyObject,org.jruby.runtime.Block)org.jruby.runtime.builtin.IRubyObject
Here's the error:
Caused by: java.lang.IllegalArgumentException: no restarg in
(java.lang.Object)java.lang.Object
at sun.dyn.MethodHandleImpl.newIllegalArgumentException(MethodHandleImpl.java:841)
at sun.dyn.MethodHandleImpl.spreadArguments(MethodHandleImpl.java:484)
at sun.dyn.MethodHandleImpl.makeGuardWithCatch(MethodHandleImpl.java:806)
at java.dyn.MethodHandles.catchException(MethodHandles.java:1397)
at org.jruby.runtime.invokedynamic.InvokeDynamicSupport.<clinit>(InvokeDynamicSupport.java:742)
... 10 more
Looks like a bug...I have not had a chance to dig into it.
- Charlie
More information about the mlvm-dev
mailing list