JDK-8072428 : Enable UseLoopCounter ergonomically if on-stack-replacement is enabled
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8u112,9
  • Priority: P5
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-02-03
  • Updated: 2018-02-15
  • Resolved: 2016-04-18
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.
8u162Fixed 9 b120Fixed
Java 9 debug build(build 1.9.0-ea-fastdebug-b48) on Linux-x64 platform hit assertion when run with "-XX:-UseLoopCounter" option. Running following command cause a crash:
java -XX:-UseLoopCounter

Got following output:
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/templateTable_x86_64.cpp:1612
# A fatal error has been detected by the Java Runtime Environment:
#  Internal Error (/HUDSON/workspace/9-2-build-linux-amd64/jdk9/2121/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp:1612), pid=23991, tid=140547934127872
#  assert(UseLoopCounter || !UseOnStackReplacement) failed: on-stack-replacement requires loop counters
# JRE version:  (9.0-b48) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.9.0-ea-fastdebug-b48 mixed mode linux-amd64 compressed oops)
# Core dump written. Default location: Core dumps may be processed with "/usr/share/apport/apport %p %s %c" (or dumping to /home/dmitry/bundles/jdk9/b48/fastdebug/bin/core.23991)
# An error report file with more information is saved as:
# /home/dmitry/bundles/jdk9/b48/fastdebug/bin/hs_err_pid23991.log
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp

java -version:
java version "1.9.0-ea-fastdebug"
Java(TM) SE Runtime Environment (build 1.9.0-ea-fastdebug-b48)
Java HotSpot(TM) 64-Bit Server VM (build 1.9.0-ea-fastdebug-b48, mixed mode)
Based on a private discussion with Igor: ILW=���UseLoopCounter unnoticeably disables UseOnStackReplacement;-UseLoopCounter & UseOnStackReplacement;none=>MMH=P3

ILW=assert,no impact on product binaries;UseLoopCounter || !UseOnStackReplacement;none=LMH=>P5

ILW= assert(UseLoopCounter || !UseOnStackReplacement) when using -XX:-UseLoopCounter, every time in this flag combo, none=LHH=P4

Compiler group needs to decide this. It would be good to remove UseLoopCounter, but it interacts with compiler options.