Crash on current head + switchpoint patch
Charles Oliver Nutter
headius at headius.com
Thu Sep 1 19:37:44 PDT 2011
On Thu, Sep 1, 2011 at 7:13 PM, Tom Rodriguez <tom.rodriguez at oracle.com> wrote:
> I reproduced it. Basically we've chosen to inline a method handle because that's what we do but the profile for the call site says it's never been invoked, so the invoke_count is 0. When we try to use that zero as a scale for inlining tests of callees we get a div by zero. The problem has always been there I think but it was masked by the inline size cutoffs. We may want to emit uncommon traps for invokedynamic call sites that haven't been reached according to profiles. I filed 7086187 for this. If you need a workaround, this should work.
>
> diff -r a32de5085326 src/share/vm/opto/bytecodeInfo.cpp
> --- a/src/share/vm/opto/bytecodeInfo.cpp
> +++ b/src/share/vm/opto/bytecodeInfo.cpp
> @@ -145,7 +145,7 @@
> }
>
> assert(invoke_count != 0, "require invocation count greater than zero");
> - int freq = call_site_count / invoke_count;
> + int freq = invoke_count > 0 ? (call_site_count / invoke_count) : 0;
Heh, I fixed it the same way :)
> By the way, after working around it, I get this:
>
> dbx) c
> MethodHandleStatics.java:102:in `newIllegalArgumentException': java.lang.IllegalArgumentException: target and fallback types must match: (ThreadContext,IRubyObject,IRubyObject,String)IRubyObject != (JRubyCallSite,ThreadContext,IRubyObject,IRubyObject,String)IRubyObject
Yeah, just fixed on master (like 15 minutes ago).
- Charlie
More information about the hotspot-compiler-dev
mailing list