RFR: 8295486: Inconsistent constant field values observed during compilation [v7]
Vladimir Kozlov
kvn at openjdk.org
Thu Jan 26 19:26:18 UTC 2023
On Thu, 26 Jan 2023 06:12:11 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> > As I see (may be wrong) you allow C2 to see all cached values which may introducing inconsistency in generated code. I am not sure how PhaseCPP::verify_type() works in such case.
>
> I'm not sure if I understand your concern, what do you mean by "all cached values"? The cache will only contain values observed during the current compilation (it's lifetime is limited by the lifetime of `ciObject` which is compile task specific) and it will ensure that the same value is used for constant folding of a specific field or array element.
After reading Vladimir's and your discussion and looking on code I see that you check value in cache before adding it to cache. So my concern is mute. But why do you need `GrowableArray` in such case? That confused me because I first thought you cache all values.
-------------
PR: https://git.openjdk.org/jdk/pull/11861
More information about the hotspot-compiler-dev
mailing list