RFR: 8358580: Rethink how classes are kept alive in training data [v2]

Aleksey Shipilev shade at openjdk.org
Fri Jul 11 09:20:10 UTC 2025


On Thu, 10 Jul 2025 17:10:22 GMT, Igor Veresov <iveresov at openjdk.org> wrote:

>> Use OopStorage directly instead of JNI handles. Note that we never destroy TrainingData objects, so we don't need to concern ourselves with freeing the OopStorage entries. Also, keeping the klasses alive is only necessary during the training run. During the replay the klasses TD objects refer to are always alive.
>
> Igor Veresov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Address review comments

I guess `klass->klass_holder()` is not needed to make sure we keep alive the class correctly, if we are running at init safepoint anyway. Given that code also works fine with storing Java mirror as root, and this change only moves that from JNI handles to OopStorage, this looks fine.

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

Marked as reviewed by shade (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/26233#pullrequestreview-3009424634


More information about the hotspot-dev mailing list