This PR tries store CONSTANT_FieldRef entries in the resolved state whenever 
it's safe to do so.

I.e., when a constant pool entry in class `A` refers to a *non-static* field 
`B.F`, 
- `B` must be the same class as `A`; or
- `B` is a supertype of `A`; or
- `B` is one of the 
[vmClasses](https://github.com/openjdk/jdk/blob/3d4185a9ce482cc655a4c67f39cb2682b02ae4fe/src/hotspot/share/classfile/vmClasses.hpp),
 and `A` is loaded by the boot class loader.

Under these conditions, it's guaranteed that whenever `A` tries to use this 
entry at run time, `B` is guaranteed to have already been resolved in A's 
system dictionary, to the same value as resolved during dump time.

Therefore, we can safely archive the `ResolvedFieldEntry` in class `A` that 
refers to `B.F`.

Note that this

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

Commit messages:
 - 8293980: Resolve CONSTANT_FieldRef at CDS dump time

Changes: https://git.openjdk.org/jdk/pull/19355/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19355&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8293980
  Stats: 1134 lines in 30 files changed: 969 ins; 57 del; 108 mod
  Patch: https://git.openjdk.org/jdk/pull/19355.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19355/head:pull/19355

PR: https://git.openjdk.org/jdk/pull/19355

Reply via email to