JDK-6765180 : Block::is_uncommon() gives wrong answer sometimes
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs14
  • Priority: P4
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2008-10-29
  • Updated: 2010-04-03
  • Resolved: 2009-01-06
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.
Other
hs15Resolved
Related Reports
Relates :  
Description
Block::is_uncommon() gives wrong answer sometimes.
As result uncommon blocks could be placed in a middle of a hot code:

0c7   B9: #     B16 <- B8  Freq: 1.37622e+06
0c7     JMP    B16
0c7
0cc   B10: #    B44 B11 <- B42  Freq: 1.37622
0cc     TEST   EBX,#384
0d2     Jne    B44  P=0.000001 C=-1.000000
0d2
0d8   B11: #    B12 <- B10  Freq: 1.37622
0d8     AND    EAX,#511
0de     MOV    EBX, EBP # CastP2X
0e0     OR     EBX,EAX
0e2
0e2   B12: #    B8 B13 <- B11 B44  Freq: 1.37622
0e2     CMPXCHG [ECX],EBX       # If EAX==[ECX] Then store EBX into [ECX]
0e6     Jeq,s  B8  P=0.999999 C=-1.000000
0e6
0e8   B13: #    B45 <- B12  Freq: 1.37622e-06
0e8     MOV    EBX,[ESP + #8]
0ec     MOV    EDX,[ESP + #12]
0f0     JMP    B45
0f0
0f5   B14: #    B45 B15 <- B6 B43  Freq: 1.37622
0f5     LEA    EDI,[ESP + #64]
0f9     FASTLOCK ECX, EDI KILLS EAX,EBP
140     Jne    B45  P=0.000001 C=-1.000000
140
146   B15: #    B8 <- B14  Freq: 1.37622
146     MOV    [ESP + #8],EBX
14a     MOV    [ESP + #16],ESI
14e     MOV    [ESP + #12],EDX
152     MOV    EBP,[ESP + #20]
156     JMP    B8
156
15b   B16: #    B57 B17 <- B9  Freq: 1.37622e+06
15b     CMPu   ESI,EAX
15d     Jge,u  B57  P=0.000001 C=-1.000000
15d

Comments
EVALUATION Block::is_uncommon() checks only immediate predecessors blocks and does not check further which could give wrong answer since it could be a chain of blocks started from an uncommon block.
29-10-2008

SUGGESTED FIX Add flag _is_uncommon into Block class.
29-10-2008