Integrated: 8282218: C1: Missing side effects of dynamic class loading during constant linkage
Vladimir Ivanov
vlivanov at openjdk.java.net
Fri May 6 23:13:47 UTC 2022
On Thu, 24 Feb 2022 13:51:18 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> (The problem is similar to JDK-8282194, but with class loading this time.)
>
> C1 handles unresolved constants by performing constant resolution at runtime and then putting the constant value into the generated code by patching it. But it treats the not-yet-resolved value as a pure constant without any side effects.
>
> It's not the case for constants which trigger class loading using custom class loaders. (All non-String constants do that.)
>
> There are no guarantees that there are no side effects during class loading, so C1 has to be conservative.
>
> Proposed fix kills memory after accessing not-yet-loaded constant in the context of any non-trusted class loader.
>
> Testing: hs-tier1 - hs-tier4
This pull request has now been integrated.
Changeset: 5212535a
Author: Vladimir Ivanov <vlivanov at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/5212535a276a92d96ca20bdcfccfbce956febdb1
Stats: 137 lines in 6 files changed: 130 ins; 1 del; 6 mod
8282218: C1: Missing side effects of dynamic class loading during constant linkage
Reviewed-by: thartmann, kvn
-------------
PR: https://git.openjdk.java.net/jdk/pull/7612
More information about the hotspot-compiler-dev
mailing list