JDK-8000821 : JSR 292: C1 fails to call virtual method (JRUBY-6920)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-10-12
  • Updated: 2013-06-26
  • Resolved: 2012-10-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 JDK 8 Other
7u40Fixed 8Fixed hs24Fixed
Related Reports
Relates :  
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
http://cr.openjdk.java.net/~twisti/8000821/
17-10-2012

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.
17-10-2012