Skip to content
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

8311080: [lworld+vector] Fix jdk build failures with different options #881

Closed
wants to merge 1 commit into from

Conversation

XiaohongGong
Copy link

@XiaohongGong XiaohongGong commented Jul 3, 2023

There are several issues exposed by building jdk image with following different options:

  • --disable-precompiled-headers
  • --with-jvm-variants=client
  • --with-jvm-variants=minimal or --disable-cds
  1. With --disable-precompiled-headers, using class MultiFieldInfo in oops/fieldInfo.hpp and oops/fieldInfo.inline.hpp builds error with "invalid use of incomplete type".

The reason is that class MultiFieldInfo is used in fieldInfo.hpp, but the header declaring the class is not included in it. A direct
fixing is including its header file oops/instanceKlass.hpp before using it. But it cannot work here since oops/instanceKlass.hpp has included oops/fieldInfo.hpp.

To resolve the circle, we can move the definition of class MultiFieldInfo to oops/fieldInfo.hpp, which I think is also reasonable since multifield is a kind of field.

  1. With --with-jvm-variants=client, calling Deoptimization::reassign_fields_by_klass() in vectorsupport.cpp builds error since reassign_fields_by_klass() is defined when C2 or JVMCI compiler is enabled (See [1]).

Consider the caller method in vectorSupport.cpp is used only for C2 compiler (See [2]), adding the same limitation for definition of all the relative methods in vectorSupport.cpp is better and can fix this issue.

  1. With --with-jvm-variants=minimal or --disable-cds, calling several CDS specific methods ([3]) in oops/inlineKlass.cpp builds error. Those caller methods defined in inlineKlass.hpp are all CDS related as well. Hence, adding the same CDS condition for them sounds reasonable and can fix this issue.

This patch also fixed an return type mismatch issue exposed by building the jdk image on aarch64 windows system. The relative method is:

jint SharedRuntime::skip_value_scalarization(InlineKlass *)

The declaration type is int (see [4]).

[1] https://github.com/openjdk/valhalla/blob/lworld%2Bvector/src/hotspot/share/runtime/deoptimization.hpp#L195
[2] https://github.com/openjdk/valhalla/blob/lworld%2Bvector/src/hotspot/share/runtime/deoptimization.cpp#L1278
[3] https://github.com/openjdk/valhalla/blob/lworld%2Bvector/src/hotspot/share/oops/instanceKlass.hpp#L1236
[4] https://github.com/openjdk/valhalla/blob/lworld%2Bvector/src/hotspot/share/runtime/sharedRuntime.hpp#L186


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8311080: [lworld+vector] Fix jdk build failures with different options (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/881/head:pull/881
$ git checkout pull/881

Update a local copy of the PR:
$ git checkout pull/881
$ git pull https://git.openjdk.org/valhalla.git pull/881/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 881

View PR using the GUI difftool:
$ git pr show -t 881

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/881.diff

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Jul 3, 2023

👋 Welcome back xgong! A progress list of the required criteria for merging this PR into lworld+vector will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Jul 3, 2023

@XiaohongGong This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8311080: [lworld+vector] Fix jdk build failures with different options

Reviewed-by: jbhateja

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been no new commits pushed to the lworld+vector branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@jatin-bhateja) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@mlbridge
Copy link

mlbridge bot commented Jul 3, 2023

Webrevs

@XiaohongGong
Copy link
Author

Hi @jatin-bhateja , could you please help to take a look at this PR? Thanks a lot!

Comment on lines +554 to +555
JRT_LEAF(int, SharedRuntime::skip_value_scalarization(InlineKlass* klass))
return (int) VectorSupport::skip_value_scalarization(klass);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing these, it will also fix the build issues with default options on Windows, I was planning to address it with JDK-8311383

@jatin-bhateja
Copy link
Member

jatin-bhateja commented Jul 5, 2023

I still see some issues with minimal and 32 bit build with following configuration on x86.
sudo ./configure --with-conf-name=linux--minimal --enable-debug --disable-precompiled-headers --with-jvm-variants=minimal --with-boot-jdk=/home/jatinbha/softwares/jdk-20 --with-default-make-target="hotspot" --with-zlib=system

We can either address it with this patch else I can handle them in a follow up RFE

@XiaohongGong
Copy link
Author

I still see some issues with minimal and 32 bit build with following configuration on x86. sudo ./configure --with-conf-name=linux--minimal --enable-debug --disable-precompiled-headers --with-jvm-variants=minimal --with-boot-jdk=/home/jatinbha/softwares/jdk-20 --with-default-make-target="hotspot" --with-zlib=system

We can either address it with this patch else I can handle them in a follow up RFE

Thanks for the review! I'm not familiar with x86 systems, so a separate patch to fix the x86 failure is better to me. Besides, I also met another issue with --with-jvm-variants=client on x86 systems, which also exists on lworld branch. You may take a look as well if possible.

@jatin-bhateja
Copy link
Member

I still see some issues with minimal and 32 bit build with following configuration on x86. sudo ./configure --with-conf-name=linux--minimal --enable-debug --disable-precompiled-headers --with-jvm-variants=minimal --with-boot-jdk=/home/jatinbha/softwares/jdk-20 --with-default-make-target="hotspot" --with-zlib=system
We can either address it with this patch else I can handle them in a follow up RFE

Thanks for the review! I'm not familiar with x86 systems, so a separate patch to fix the x86 failure is better to me. Besides, I also met another issue with --with-jvm-variants=client on x86 systems, which also exists on lworld branch. You may take a look as well if possible.

Ok, I will address them with JDK-8311383

Copy link
Member

@jatin-bhateja jatin-bhateja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing these.

Best Regards,
Jatin

@XiaohongGong
Copy link
Author

Thanks for addressing these.

Best Regards, Jatin

Thanks for the fixing the review!

@XiaohongGong
Copy link
Author

/integrate

@openjdk openjdk bot added the sponsor label Jul 5, 2023
@openjdk
Copy link

openjdk bot commented Jul 5, 2023

@XiaohongGong
Your change (at version 8ae7955) is now ready to be sponsored by a Committer.

@jatin-bhateja
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 5, 2023

Going to push as commit bb13513.

@openjdk openjdk bot added the integrated label Jul 5, 2023
@openjdk openjdk bot closed this Jul 5, 2023
@openjdk
Copy link

openjdk bot commented Jul 5, 2023

@jatin-bhateja @XiaohongGong Pushed as commit bb13513.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@XiaohongGong XiaohongGong deleted the JDK-8311080 branch July 5, 2023 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants