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 :  
Charlie Nutter found an issue in C1 and filed a JRuby bug for it:


The reduced test case is:

10000.times do
  rescue TypeError

$ 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


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.