-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge lworld #866
Merge lworld #866
Conversation
Reviewed-by: mcimadamore
Reviewed-by: shade, coleenp, tschatzl
…or SSLEngineTemplate Reviewed-by: xuelei
Reviewed-by: psandoz, tvaleev, rriggs
Reviewed-by: kizune
…ore checking exceptions Reviewed-by: dholmes, alanb
…gs as per RFC 5646 convention Reviewed-by: naoto, rriggs
…ootstrap arguments Reviewed-by: asotona
…r for incompatible processes Reviewed-by: alanb
Reviewed-by: prr
Reviewed-by: prr, dnguyen
Co-authored-by: Raffaello Giulietti <rgiulietti@openjdk.org> Reviewed-by: scolebourne, naoto
Reviewed-by: sspitsyn
Reviewed-by: alanb, sspitsyn
…rtual threads Reviewed-by: alanb, pchilanomate, cjplummer
…ring Reviewed-by: fyang
Reviewed-by: sviswanathan, qamai, thartmann
Reviewed-by: stefank, tschatzl, kbarrett
…lection Reviewed-by: shade, ayang, tschatzl
Reviewed-by: alanb, dfuchs, djelinski
Reviewed-by: mcimadamore, rriggs, darcy
Reviewed-by: erikj, djelinski
…er/InterfaceObjectTest.java Reviewed-by: coleenp, dholmes
Reviewed-by: sspitsyn, iklam
Reviewed-by: mgronlun, coleenp
…eg `@requires` clause Reviewed-by: rriggs, azvegint
…leOutputStream, and RandomAccessFile Reviewed-by: alanb, bpb
…them being escape hatches Reviewed-by: psandoz
Reviewed-by: sspitsyn, dfuchs, alanb
…l JDK and hotspot libjvm static libraries Reviewed-by: erikj, sgehwolf
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. |
I do not want to make more changes in this merge, can we can address this in next merge ? |
Yes, I plan to address it after this merge, currently there is a discrepancy b/w field count returned by ciInstanceKlass::nof_nonstatic_fields() vs InlineTypeNode::field_count(), this is because ci* data model directly works over oops data model which is populated by classFileParser, thus a multifield is a regular field @multifield annotation, its only during c2 parsing we scalarize it. We will need to add a new interface to query supported vector size in ciInstance which is implemented by both the compilers, this will be used to return correct field count which matches with IR. |
Sure, having a next merge is fine to me. Thanks! |
Could you please take a look at the similar changes in https://github.com/openjdk/valhalla/pull/863/files#diff-b0ea998b1ae6491c87dae54a2a70644f8e957e7f3522f780883d72fb29107aea, which the compiler firstly get the If the changes under |
Yes, I grepped though the code and currently there are not many occurrences of "nof_declared_nonstatic_fields" and your patch #863 is addressing them, But having consistency b/w field count returned by ci* object model and C2 IR is also desirable. All the ci* query APIs which returns ciField based on offset / index have already been extended to support multifield. But I plan to revisit them after merge patch gets integrated. |
Yes, I agree that adding such an interface can simply many code. However, for the multifield vectorization, it doesn't only need to check the supported vector size, but also the relative ops with the vector size. Do you plan to check these ops as well? To clean more, I think it's better to add the multifields to the non_static_fields at the stage of ci field parsing based on the |
Correct, newly introduced interface should check for Load/Store/BroadCast Operations similar to InlineTypeNode::is_multifield_scalarized
Yes, as mentioned I will revisit ciField side of handling after merge and will add newly discussed interface so that ci* field count is in sync with C2 IR. We are bookkeeping multifield in a special ciMultifield structure currently and field query APIs based on index / offset traverses this structure. Both offset and index based traversal should perform a linearized walk over this hierarchical structure, since all the FieldInfo objects now contains unique indices. 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]. |
/contributor add @XiaohongGong |
@jatin-bhateja |
Make sense to me. Thanks! |
I'm fine with this patch except for some comments I added above and the jtreg crashes. Thanks! |
Are you still facing JTREG crashes with -Xshare:off ?
Failures are of similar kind around masked vector operations and looks like related to de-optimization. With UseAVX2 I am also able to reproduces similar issue in stand alone test
|
Ohh, I forgot this flag. I will rerun with it. Thanks!
Yes, I met the same incorrectness issue with deoptimization, and did not get the root cause yet. We can look at this issue once your patch is merged. |
The jtreg crashes are gone with |
Hi @XiaohongGong , I have addresses and responded to all comments. Let me know if its good to merge now. |
I have submitted a patch on mainline to backout shuffle related changes citing performance issues JDK-8310459. So these classes may be needed in next mainline merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
/integrate |
Going to push as commit d44617c. |
@jatin-bhateja Pushed as commit d44617c. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
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::nof_nonstatic_field() and is agnostic to scalarization, instead it should consider the actual count of inputs fields connected to InlineTypeIR node [12]
F) A minor change in scalarization logic of multi-fields [13]
With above changes in place most of the VectorAPI JTREG test points around vector/shuffle/masks are passing, we plan to fix remaining regressions with subsequent check-ins.
[1] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/oops/inlineKlass.cpp#L541
[2] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/java.base/share/classes/java/lang/Class.java#L616
[3] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/classfile/classFileParser.cpp#L1527
[4] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/classfile/classFileParser.cpp#L1644
[5] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/classfile/classFileParser.cpp#L1692
[6] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/classfile/classFileParser.cpp#L1611
[7] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/opto/vectornode.hpp#L1714
[8] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/opto/vectornode.hpp#L1716
[9] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/prims/vectorSupport.cpp#L320
[10] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/prims/vectorSupport.cpp#L323
[11] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/opto/inlinetypenode.cpp#L858
[12] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/opto/inlinetypenode.cpp#L327
[13] https://github.com/jatin-bhateja/valhalla/blob/84b3b1e11cdef2c870d1f430c7db2ae60f752d5f/src/hotspot/share/opto/inlinetypenode.cpp#L44
Progress
Reviewers
Contributors
<xgong@openjdk.org>
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/866/head:pull/866
$ git checkout pull/866
Update a local copy of the PR:
$ git checkout pull/866
$ git pull https://git.openjdk.org/valhalla.git pull/866/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 866
View PR using the GUI difftool:
$ git pr show -t 866
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/866.diff
Webrev
Link to Webrev Comment