[lworld+vector] RFR: Merge lworld
Xiaohong Gong
xgong at openjdk.org
Sun Jun 25 04:12:25 UTC 2023
On Thu, 22 Jun 2023 06:47:31 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
> Merge from lworld in lworld+vector, JDK-8292818 made significant modification to FieldInfo by replacing 96 bits fixed set of metadata fields with UNSIGNED5 compressed fields.
>
> Other Fixes addressed:-
>
> A) CDS related:
> - All the _VectorPayloadMF*_ classes are part of java.base modules and thus gets archived into a classes.jsa.
> - Code for bookkeeping InlineKlassFixedBlock pointer containing packing/unpacking adapters, exact bundle size etc. is removed from lworld branch, this causes problem in down stream flow accessing those fields.
>
> - InstanceKlass::size method takes into account size of InlineKlassFixedBlock and therefore its contents are already part of shared archive, reinitialized the pointer by making an explicit call to _inlineklass_static_block()_ [1] during unshared field restoration.
>
> - Java class structure [2] contains primaryType (pointer to primitive klass mirrors) and secondaryTypes (pointer to primitive values mirrors), these are no-longer getting restored during shared archive loading at VM startup. These pointer are used for class level equality comparison. As a workaround, using -Xshare:off flag during regression testing, this will be fixed in a follow up patch.
>
> B) Removed redundant ResourceMarks during field parsing [3], this was resulting into crashes during re-allocations of __temp_field_info_ (a GrowableArray) due to __nesting_ level mismatch b/w actual allocation site and re-allocation sites. Re-allocations happens because upfront space reservation for growable array do not take into account multifield bundle size.
>
> C) JDK-8292818 added a new __index_ field on top regular fields specified in JVM specification (name_index, signature_index, flags_index, access_index) into FieldInfo structure, handled its initialization while parsing multifield[4], injected[5] and user defined fields[6].
>
> D) Small change in VectorBox creation routine for proper initialization[7] of _declared_nonstatic_fields before accessing it[8].
>
> E) De-optimization related:-
> - De-coupled[9] allocation and re-assignment during vector box re-materialization leveraging existing re-assignment framework[10]. This prevents introducing special handlings for non-vector Locations in existing routines since an InlineTypeNode may have scalar / vector / constant inputs (scalarized multifield bundle initialization during make_default [11]).
>
> - nfield count which determines number of field level bookkeeping at SafePoint was initialized using _ciInlineKlass::...
Hi @jatin-bhateja ,
I ran the jtreg tests like `Byte128VectorTests.java` on ARM Neon machines, but I got too many such crashes:
test Byte128VectorTests.withByte128VectorTests(byte[i + 1]): failure
java.lang.NoClassDefFoundError: Could not initialize class jdk.internal.vm.vector.VectorSupport$VectorPayloadMF128B
at java.base/jdk.internal.vm.vector.VectorSupport$VectorPayloadMF.newInstanceFactory(VectorSupport.java:187)
at jdk.incubator.vector/jdk.incubator.vector.AbstractSpecies.makeDummyVectorMF(AbstractSpecies.java:369)
at jdk.incubator.vector/jdk.incubator.vector.AbstractSpecies.dummyVectorMF(AbstractSpecies.java:327)
at jdk.incubator.vector/jdk.incubator.vector.ByteVector$ByteSpecies.dummyVectorMF(ByteVector.java:4314)
at jdk.incubator.vector/jdk.incubator.vector.ByteVector.fromArray(ByteVector.java:3080)
at Byte128VectorTests.withByte128VectorTests(Byte128VectorTests.java:3755)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:132)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:599)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:174)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:822)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:147)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1593)
at org.testng.TestRunner.privateRun(TestRunner.java:764)
at org.testng.TestRunner.run(TestRunner.java:585)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:384)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:378)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:337)
at org.testng.SuiteRunner.run(SuiteRunner.java:286)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1218)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.runSuites(TestNG.java:1069)
at org.testng.TestNG.run(TestNG.java:1037)
at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:102)
at com.sun.javatest.regtest.agent.TestNGRunner.main(TestNGRunner.java:58)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.AssertionError [in thread "MainThread"]
at java.base/java.lang.reflect.Field.<init>(Field.java:133)
at java.base/java.lang.reflect.Field.copy(Field.java:160)
at java.base/java.lang.reflect.ReflectAccess.copyField(ReflectAccess.java:109)
at java.base/jdk.internal.reflect.ReflectionFactory.copyField(ReflectionFactory.java:281)
at java.base/java.lang.Class.getDeclaredField(Class.java:2886)
at java.base/jdk.internal.vm.vector.VectorSupport$VectorPayloadMF.multiFieldOffset(VectorSupport.java:326)
at java.base/jdk.internal.vm.vector.VectorSupport$VectorPayloadMF128B.<clinit>(VectorSupport.java:437)
at java.base/jdk.internal.vm.vector.VectorSupport$VectorPayloadMF.newInstanceFactory(VectorSupport.java:187)
at jdk.incubator.vector/jdk.incubator.vector.AbstractSpecies.makeDummyVectorMF(AbstractSpecies.java:369)
at jdk.incubator.vector/jdk.incubator.vector.AbstractSpecies.dummyVectorMF(AbstractSpecies.java:327)
at jdk.incubator.vector/jdk.incubator.vector.ByteVector$ByteSpecies.dummyVectorMF(ByteVector.java:4314)
at jdk.incubator.vector/jdk.incubator.vector.ByteVector.fromArray(ByteVector.java:3080)
at Byte128VectorTests.ABSByte128VectorTests(Byte128VectorTests.java:5227)
... 29 more
Did I miss something?
Thanks,
Xiaohong
Could you please rebase this merge with latest `lworld`, since I merged a fix several days ago on that branch: https://github.com/openjdk/valhalla/pull/860 ?
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/866#issuecomment-1605860231
PR Comment: https://git.openjdk.org/valhalla/pull/866#issuecomment-1605860436
More information about the valhalla-dev
mailing list