RFR: 8329699: GenShen: Move promotion logic out of shHeap and shHeapRegion

William Kemper wkemper at openjdk.org
Thu Apr 4 18:20:43 UTC 2024


The code to handle promotions during evacuation has been moved into a new class in its own files: `shGenerationalEvacuationTask`

The methods for managing `plabs` have been moved into `shGenerationalHeap`. `plabs` are now also only created when running the generational mode.


-  inline HeapWord* allocate_from_plab(Thread* thread, size_t size, bool is_promotion);
-  HeapWord* allocate_from_plab_slow(Thread* thread, size_t size, bool is_promotion);
-  HeapWord* allocate_new_plab(size_t min_size, size_t word_size, size_t* actual_size);
-  void retire_plab(PLAB* plab);
-  void retire_plab(PLAB* plab, Thread* thread);


The code to handle promotion in place has been moved from `shHeapRegion` into `shGenerationalEvacuationTask`:

-  void promote_humongous();
-  void promote_in_place();


Unused methods related to global coalesce and fill have been deleted from `shHeapRegion`:

-  void global_oop_iterate_and_fill_dead(OopIterateClosure* cl);
-  void global_oop_iterate_objects_and_fill_dead(OopIterateClosure* cl);
-  void oop_iterate_humongous(OopIterateClosure* cl);
-  void oop_iterate_humongous(OopIterateClosure* cl, HeapWord* start, size_t words);


Additionally, these methods in `shHeap` which just delegated to old or young generation instances have more or less been inlined at the usage site (many `includes` have been fixed):

-  ShenandoahOldHeuristics* old_heuristics();
-  ShenandoahYoungHeuristics* young_heuristics();
-
-  bool doing_mixed_evacuations();
-  bool is_old_bitmap_stable() const;
-  bool is_gc_generation_young() const;


The boolean `is_promotion` that was passed through all of the allocation calls has been moved into `shAllocRequest` to reduce the upstream delta for `shHeap`.

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

Commit messages:
 - Restore lost copyright comment in new file
 - Merge remote-tracking branch 'shenandoah/master' into shenandoah-heap-isolation
 - Restore preserved marks before rebuilding free set
 - Make evacuate_object virtual
 - Only create PLABs for generational mode
 - Move over plab retirement methods
 - Fix zero build
 - Move plab allocations out of shenandoahHeap
 - Move region promotion out of shenandoahHeapRegion
 - Separate generational evacuation/promotion methods
 - ... and 13 more: https://git.openjdk.org/shenandoah/compare/f43034d8...e398ce38

Changes: https://git.openjdk.org/shenandoah/pull/415/files
  Webrev: https://webrevs.openjdk.org/?repo=shenandoah&pr=415&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8329699
  Stats: 1875 lines in 36 files changed: 968 ins; 791 del; 116 mod
  Patch: https://git.openjdk.org/shenandoah/pull/415.diff
  Fetch: git fetch https://git.openjdk.org/shenandoah.git pull/415/head:pull/415

PR: https://git.openjdk.org/shenandoah/pull/415


More information about the shenandoah-dev mailing list