JDK-8233124 : [lworld] TestBasicFunctionality::test12 fails due to invalid field values after deoptimization
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: repo-valhalla
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-10-29
  • Updated: 2019-10-29
  • Resolved: 2019-10-29
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
repo-valhallaFixed
Related Reports
Relates :  
Description
TestBasicFunctionality::test12 fails due to invalid field values after deoptimization

 stderr: [Exception in thread "main" java.lang.reflect.InvocationTargetException
	at jdk.internal.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:565)
	at compiler.valhalla.valuetypes.ValueTypeTest.run(ValueTypeTest.java:681)
	at compiler.valhalla.valuetypes.ValueTypeTest.run(ValueTypeTest.java:397)
	at compiler.valhalla.valuetypes.TestBasicFunctionality.main(TestBasicFunctionality.java:53)
Caused by: java.lang.RuntimeException: assertEquals: expected 24378 to equal 27528
	at jdk.test.lib.Asserts.fail(Asserts.java:594)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
	at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
	at jdk.test.lib.Asserts.assertEQ(Asserts.java:166)
	at compiler.valhalla.valuetypes.TestBasicFunctionality.test12_verifier(TestBasicFunctionality.java:282)
	... 6 more
Comments
http://hg.openjdk.java.net/valhalla/valhalla/rev/63b524b16e22
29-10-2019

PhaseMacroExpand::can_eliminate_allocation incorrectly returns true because it confuses a StoreP user that initializes a value type oop field with a mark word store: 404 CheckCastPP === 401 399 [[ 1223 1104 ]] #int[int:1]:NotNull:exact *,iid=387 !jvms: MyValue1::createWithFieldsInline @ bci:37 TestBasicFunctionality::test40 @ bci:12 1224 AddP === _ 1 1161 1220 [[ 1223 ]] !jvms: TestBasicFunctionality::test40 @ bci:15 1159 Proj === 1149 [[ 1165 1169 1175 1181 1187 1192 1247 1205 1211 1217 1223 1229 1235 1241 ]] #2 Memory: @rawptr:BotPTR, idx=Raw; !jvms: TestBasicFunctionality::test40 @ bci:15 1154 CatchProj === 1153 [[ 1162 1169 1175 1181 1187 1192 1247 1205 1211 1217 1223 1229 1235 1241 ]] #0@bci -1 !jvms: TestBasicFunctionality::test40 @ bci:15 1223 StoreP === 1154 1159 1224 404 [[ 1162 ]] @compiler/valhalla/valuetypes/MyValue1:exact+56 *, name=oa, idx=21; Memory: @rawptr:NotNull, idx=Raw; !orig=1222 !jvms: TestBasicFunctionality::test40 @ bci:15 This code added by JDK-8206144 is incorrect: http://hg.openjdk.java.net/valhalla/valhalla/rev/7195b88670fa#l12.7
29-10-2019