JDK-8240976 : [JVMCI] MethodProfileWidth flag is broken
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 11-pool,15
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-03-13
  • Updated: 2021-01-04
  • Resolved: 2020-03-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.
JDK 11 JDK 15
11.0.8-oracleFixed 15 b15Fixed
Description
VM crashes if not 0 value is used for MethodProfileWidth flag:

java -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:MethodProfileWidth=2 -version

FAILED verify : actual mdp 0x7f6b1c17dbe8   expected mdp 0x7f6b1c17dbc8 @ bci 11
  actual di 120   expected di 88
  actual bci is 15  expected bci 11
method data for {method} {0x000000080035bf68} 'equals' '(Ljava/lang/Object;)Z' in 'java/lang/String'
0     bci: 2    BranchData          taken(1) displacement(32)
                                    not taken(0)
32    bci: 8    ReceiverTypeData    count(0) nonprofiled_count(0) entries(1)
                                    'java/lang/String'(1 1.00)
88    bci: 11   BranchData          taken(0) displacement(168)
                                    not taken(0)
120   bci: 15   ReceiverTypeData    count(0) nonprofiled_count(0) entries(0)
176   bci: 22   BranchData          taken(0) displacement(64)
                                    not taken(0)
208   bci: 33   BranchData          taken(0) displacement(48)
                                    not taken(0)
240   bci: 44   CounterData         count(0)
--- Extra data:
304   bci: 0    ArgInfoData           0x0  0x0
0 nofast_aload_0
1 aload_1
2 if_acmpne 7
  0   bci: 2    BranchData          taken(1) displacement(32)
                                    not taken(0)
5 iconst_1
6 ireturn
7 aload_1
8 instanceof 10 <java/lang/String>
  32  bci: 8    ReceiverTypeData    count(0) nonprofiled_count(0) entries(1)
                                    'java/lang/String'(1 1.00)
11 ifeq 48
  88  bci: 11   BranchData          taken(0) displacement(168)
                                    not taken(0)
14 aload_1
15 checkcast 10 <java/lang/String>
  120 bci: 15   ReceiverTypeData    count(0) nonprofiled_count(0) entries(0)
18 astore_2
19 getstatic 34 <java/lang/String.COMPACT_STRINGS/Z> 
22 ifeq 36
  176 bci: 22   BranchData          taken(0) displacement(64)
                                    not taken(0)
25 nofast_aload_0
26 nofast_getfield 15 <java/lang/String.coder/B> 
29 aload_2
30 nofast_getfield 15 <java/lang/String.coder/B> 
33 if_icmpne 48
  208 bci: 33   BranchData          taken(0) displacement(48)
                                    not taken(0)
36 nofast_aload_0
37 nofast_getfield 9 <java/lang/String.value/[B> 
40 aload_2
41 nofast_getfield 9 <java/lang/String.value/[B> 
44 invokestatic 182 <java/lang/StringLatin1.equals([B[B)Z> 
  240 bci: 44   CounterData         count(0)
47 ireturn
48 iconst_0
49 ireturn
# To suppress the following error report, specify this argument
# after -XX: or in .hotspotrc:  SuppressErrorAt=/interpreterRuntime.cpp:1164
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  Internal Error (open/src/hotspot/share/interpreter/interpreterRuntime.cpp:1164), pid=23889, tid=23890
#  assert(mdp == mdp2) failed: wrong mdp
#

Comments
jdk11u backport: Mark as jdk11u-jvmci-defer. Given the many missing JVMCI changes I skip this one.
18-05-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/0a2e12c3e6e3 User: kvn Date: 2020-03-17 17:38:51 +0000
18-03-2020

http://cr.openjdk.java.net/~kvn/8240976/webrev.00/
13-03-2020

Good. I will remove this flag.
13-03-2020

ILW = Crash in interpreter, with JVMCI and -XX:MethodProfileWidth>0, disable JVMCI = HLM = P3
13-03-2020

Graal never got around to actually using method profiles so the MethodProfileWidth code is pretty much untested/bit rotten. I suggest removing it until such time that resources are available for further investigating use of method profiles in Graal (or C2).
13-03-2020