JDK-8296014 : EA does not work with G1 after JDK-8242115
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 20
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • CPU: generic
  • Submitted: 2022-10-28
  • Updated: 2022-12-14
  • Resolved: 2022-10-31
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 20
20Resolved
Related Reports
Duplicate :  
Description
In the next test case all allocations are eliminated with Iterative EA with Parallel GC but failed with G1:

NotScalar (Field load)  42  CheckCastPP  === 39 37  [[ 423 295 295 167 167 180 90 90 ]]   Oop:TestEA$B:NotNull:exact *,iid=25 !jvms: TestEA::test @ bci:0 (line 12)
  >>>>  379  LoadN  === 374 169 167  [[ 380 ]]  @TestEA$B:BotPTR+12 * [narrow], name=a, idx=6; (does not depend only on test, pinned)  Type:narrowoop: TestEA$A:BotPTR * !jvms: TestEA::test @ bci:37 (line 15)
NotScalar (Field load)  42  CheckCastPP  === 39 37  [[ 423 295 295 167 167 180 90 90 ]]   Oop:TestEA$B:NotNull:exact *,iid=25 !jvms: TestEA::test @ bci:0 (line 12)
  >>>>  379  LoadN  === 374 169 167  [[ 380 ]]  @TestEA$B:BotPTR+12 * [narrow], name=a, idx=6; (does not depend only on test, pinned)  Type:narrowoop: TestEA$A:BotPTR * !jvms: TestEA::test @ bci:37 (line 15)

LocalVar(39) NoEscape(NoEscape) -> ArgEscape(NoEscape) escapes as arg to: 402  CallLeaf  === 393 1 310 1 1 (380 171 ) [[ 403 404 ]] # write_ref_field_pre_entry void ( java/lang/Object:NotNull *, rawptr:NotNull )  Type:{0:control, 1:abIO, 2:memory, 3:rawptr:BotPTR, 4:return_address} !jvms: TestEA::test @ bci:37 (line 15)

Comments
Looks like I did not rebuild my local JDK after I pulled JDK-8295066 fix. After rebuilding the test passed.
28-10-2022

ILW = Previously removed allocation is not eliminated anymore, medium?, use different GC = MMH = P3
28-10-2022

EA works with G1 (allocations eliminated) after I backout JDK-8242115 changes.
28-10-2022

Tested with build which has JDK-8295066 fix.
28-10-2022

To reproduce: java -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+PrintEscapeAnalysis TestEA
28-10-2022