[lworld+vector] RFR: 8311080: [lworld+vector] Fix jdk build failures with different options
Xiaohong Gong
xgong at openjdk.org
Tue Jul 4 01:47:19 UTC 2023
On Mon, 3 Jul 2023 08:46:04 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
> 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`.
>
> 2. 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.
>
> 3. 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
Hi @jatin-bhateja , could you please help to take a look at this PR? Thanks a lot!
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/881#issuecomment-1619340723
More information about the valhalla-dev
mailing list