RFR: 8317350: Move code cache purging out of CodeCache::UnloadingScope

Thomas Schatzl tschatzl at openjdk.org
Tue Oct 3 13:04:03 UTC 2023


Hi all,

  please review this refactoring that moves actual code cache flushing/purging out of `CodeCache::UnloadingScope`. Reasons:

* I prefer that a destructor does not do anything substantial - in some cases, 90% of time is spent in the destructor in that extracted method (due to https://bugs.openjdk.org/browse/JDK-8316959)
* imho it does not fit the class which does nothing but sets/resets some code cache unloading behavior (probably should be renamed to `UnloadingBehaviorScope` too in a separate CR).
* other existing methods at that level are placed out of that (or any other) scope object too - which is already the case for when doing concurrent unloading.
* putting it there makes future logging of the various phases a little bit easier, not having `GCTraceTimer` et al. in various places.

Testing: gha

Thanks,
  Thomas

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

Commit messages:
 - 8317350 move codecache purging out of unloading scope

Changes: https://git.openjdk.org/jdk/pull/16011/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16011&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8317350
  Stats: 60 lines in 7 files changed: 26 ins; 6 del; 28 mod
  Patch: https://git.openjdk.org/jdk/pull/16011.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16011/head:pull/16011

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


More information about the shenandoah-dev mailing list