RFR: 8282218: C1: Missing side effects of dynamic class loading during constant linkage [v2]

Vladimir Ivanov vlivanov at openjdk.java.net
Fri May 6 20:23:48 UTC 2022


> (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

Vladimir Ivanov has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:

 - helper method to access constant pool tag
 - Merge branch 'master' into 8282218.c1.class_loading
 - 8282218: C1: Missing side effects of dynamic class loading during constant linkage

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7612/files
  - new: https://git.openjdk.java.net/jdk/pull/7612/files/bf442f0f..6f2cf416

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7612&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7612&range=00-01

  Stats: 379198 lines in 5868 files changed: 272514 ins; 51118 del; 55566 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7612.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7612/head:pull/7612

PR: https://git.openjdk.java.net/jdk/pull/7612


More information about the hotspot-compiler-dev mailing list