United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8000821 JSR 292: C1 fails to call virtual method (JRUBY-6920)
JDK-8000821 : JSR 292: C1 fails to call virtual method (JRUBY-6920)

Details
Type:
Bug
Submit Date:
2012-10-12
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2012-10-23
Component:
hotspot
OS:
Sub-Component:
compiler
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
Fixed Versions:
hs25 (b07)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
Charlie Nutter found an issue in C1 and filed a JRuby bug for it:

http://jira.codehaus.org/browse/JRUBY-6920

The reduced test case is:

10000.times do
  begin
    ENV[1]
    raise
  rescue TypeError
  end
end

$ jruby -J-showversion -J-d32 -J-client -J-Xbatch JRUBY-6920.rb 
java version "1.8.0-ea"
Java(TM) SE Runtime Environment (build 1.8.0-ea-b60)
Java HotSpot(TM) Client VM (build 25.0-b04, mixed mode)

RuntimeError: No current exception
  (root) at JRUBY-6920.rb:4
   times at org/jruby/RubyFixnum.java:273
  (root) at JRUBY-6920.rb:1

                                    

Comments
GraphBuilder::try_method_handle_inline calls GraphBuilder::try_inline to inline the target of method handle calls.  But try_inline doesn't do CHA; GraphBuilder::invoke does that.

The easy fix for now without refactoring the whole logic in C1 (which is not trivial, I tried) is to only inline static and statically bindable methods for method handle calls.  This shouldn't affect performance since most methods are statically bindable and C2 doesn't have this problem.
                                     
2012-10-17
http://cr.openjdk.java.net/~twisti/8000821/
                                     
2012-10-17
URL:   http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/fd1d564dd460
User:  twisti
Date:  2012-10-23 02:38:24 +0000

                                     
2012-10-23
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/fd1d564dd460
User:  amurillo
Date:  2012-10-26 23:51:00 +0000

                                     
2012-10-26



Hardware and Software, Engineered to Work Together