Skip to content

Commit

Permalink
Merge remote-tracking branch 'shenandoah/master' into great-genshen-p…
Browse files Browse the repository at this point in the history
…r-redux
  • Loading branch information
earthling-amzn committed Oct 21, 2024
2 parents 928ae32 + 47d77e1 commit 2a2aa40
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
8 changes: 6 additions & 2 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,8 +573,12 @@ void ShenandoahHeap::print_on(outputStream* st) const {

st->print("Status: ");
if (has_forwarded_objects()) st->print("has forwarded objects, ");
if (is_concurrent_old_mark_in_progress()) st->print("old marking, ");
if (is_concurrent_young_mark_in_progress()) st->print("young marking, ");
if (!mode()->is_generational()) {
if (is_concurrent_mark_in_progress()) st->print("marking,");
} else {
if (is_concurrent_old_mark_in_progress()) st->print("old marking, ");
if (is_concurrent_young_mark_in_progress()) st->print("young marking, ");
}
if (is_evacuation_in_progress()) st->print("evacuating, ");
if (is_update_refs_in_progress()) st->print("updating refs, ");
if (is_degenerated_gc_in_progress()) st->print("degenerated gc, ");
Expand Down
6 changes: 5 additions & 1 deletion src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,11 @@ class ShenandoahHeap : public CollectedHeap {
inline bool is_in_active_generation(oop obj) const;
inline bool is_in_young(const void* p) const;
inline bool is_in_old(const void* p) const;
inline bool is_old(oop pobj) const;

// Returns true iff the young generation is being collected and the given pointer
// is in the old generation. This is used to prevent the young collection from treating
// such an object as unreachable.
inline bool is_in_old_during_young_collection(oop obj) const;

inline ShenandoahAffiliation region_affiliation(const ShenandoahHeapRegion* r);
inline void set_affiliation(ShenandoahHeapRegion* r, ShenandoahAffiliation new_affiliation);
Expand Down
8 changes: 4 additions & 4 deletions src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,10 @@ inline bool ShenandoahHeap::is_in_active_generation(oop obj) const {
return true;
case ShenandoahAffiliation::YOUNG_GENERATION:
// Young regions are in young_generation and global_generation, not in old_generation
return gen != (ShenandoahGeneration*)old_generation();
return !gen->is_old();
case ShenandoahAffiliation::OLD_GENERATION:
// Old regions are in old_generation and global_generation, not in young_generation
return gen != (ShenandoahGeneration*)young_generation();
// Old regions are in old_generation and no others
return gen->is_old();
default:
assert(false, "Bad affiliation (%d) for region " SIZE_FORMAT, _affiliations[index], index);
return false;
Expand All @@ -391,7 +391,7 @@ inline bool ShenandoahHeap::is_in_old(const void* p) const {
return is_in_reserved(p) && (_affiliations[heap_region_index_containing(p)] == ShenandoahAffiliation::OLD_GENERATION);
}

inline bool ShenandoahHeap::is_old(oop obj) const {
inline bool ShenandoahHeap::is_in_old_during_young_collection(oop obj) const {
return active_generation()->is_young() && is_in_old(obj);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ inline bool ShenandoahMarkingContext::is_marked_weak(oop obj) const {
}

inline bool ShenandoahMarkingContext::is_marked_or_old(oop obj) const {
return is_marked(obj) || ShenandoahHeap::heap()->is_old(obj);
return is_marked(obj) || ShenandoahHeap::heap()->is_in_old_during_young_collection(obj);
}

inline bool ShenandoahMarkingContext::is_marked_strong_or_old(oop obj) const {
return is_marked_strong(obj) || ShenandoahHeap::heap()->is_old(obj);
return is_marked_strong(obj) || ShenandoahHeap::heap()->is_in_old_during_young_collection(obj);
}

inline HeapWord* ShenandoahMarkingContext::get_next_marked_addr(const HeapWord* start, const HeapWord* limit) const {
Expand Down

0 comments on commit 2a2aa40

Please sign in to comment.