RFR: 8295486: Inconsistent constant field values observed during compilation [v2]
Tobias Hartmann
thartmann at openjdk.org
Thu Jan 19 16:26:03 UTC 2023
On Thu, 19 Jan 2023 00:18:41 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> Speaking of relation between ciConstant and ciObject, ciConstant.hpp only refers to ciObject*, so the cycle can be broken by prepending class ciObject; in ciConstant.hpp.
That won't help. All `ci*` classes, including `ciObject`, are already forward declared in `ciClassList.hpp` which is included in `ciConstant.hpp`. The following usages in `ciConstant` require a complete `ciObject` type:
https://github.com/openjdk/jdk/blob/c5c8c0644d9442846de15422285fffeb91c3e0a1/src/hotspot/share/ci/ciConstant.hpp#L115
https://github.com/openjdk/jdk/blob/c5c8c0644d9442846de15422285fffeb91c3e0a1/src/hotspot/share/ci/ciConstant.hpp#L134
Another issue is that `ciConstant.hpp` includes `ciNullObject.hpp` which inherits from `ciObject`. I worked around both issues by moving code and includes around.
I moved the code to `ciObject`, as you proposed, and extended it to include final fields as well. Let me know what you think.
Testing now revealed a new "Not monotonic" assert that seems to be triggered by caching non-stable final fields. I'll investigate but I'm not able to reproduce it yet.
-------------
PR: https://git.openjdk.org/jdk/pull/11861
More information about the hotspot-compiler-dev
mailing list