Skip to content

Commit

Permalink
8324210: Serial: Remove unused methods in Generation
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl, stefank
  • Loading branch information
albertnetymk committed Jan 23, 2024
1 parent bcb340d commit f5e6d11
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
15 changes: 0 additions & 15 deletions src/hotspot/share/gc/serial/generation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,18 +183,3 @@ bool Generation::block_is_obj(const HeapWord* p) const {
((Generation*)this)->space_iterate(&blk);
return blk.is_obj;
}

class GenerationObjIterateClosure : public SpaceClosure {
private:
ObjectClosure* _cl;
public:
virtual void do_space(Space* s) {
s->object_iterate(_cl);
}
GenerationObjIterateClosure(ObjectClosure* cl) : _cl(cl) {}
};

void Generation::object_iterate(ObjectClosure* cl) {
GenerationObjIterateClosure blk(cl);
space_iterate(&blk);
}
26 changes: 0 additions & 26 deletions src/hotspot/share/gc/serial/generation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class Generation: public CHeapObj<mtGC> {
enum Name {
DefNew,
MarkSweepCompact,
Other
};

enum SomePublicConstants {
Expand All @@ -99,9 +98,6 @@ class Generation: public CHeapObj<mtGC> {
GenGrain = 1 << LogOfGenGrain
};


virtual Generation::Name kind() { return Generation::Other; }

virtual size_t capacity() const = 0; // The maximum number of object bytes the
// generation can currently hold.
virtual size_t used() const = 0; // The number of used bytes in the gen.
Expand All @@ -112,10 +108,6 @@ class Generation: public CHeapObj<mtGC> {
// for the allocation of objects.
virtual size_t max_capacity() const;

// If this is a young generation, the maximum number of bytes that can be
// allocated in this generation before a GC is triggered.
virtual size_t capacity_before_gc() const { return 0; }

// The largest number of contiguous free bytes in the generation,
// including expansion (Assumes called at a safepoint.)
virtual size_t contiguous_available() const = 0;
Expand Down Expand Up @@ -236,28 +228,10 @@ class Generation: public CHeapObj<mtGC> {
GCStats* gc_stats() const { return _gc_stats; }
virtual void update_gc_stats(Generation* current_generation, bool full) {}

// Accessing "marks".

// This function gives a generation a chance to note a point between
// collections. For example, a contiguous generation might note the
// beginning allocation point post-collection, which might allow some later
// operations to be optimized.
virtual void save_marks() {}

// This function is "true" iff any no allocations have occurred in the
// generation since the last call to "save_marks".
virtual bool no_allocs_since_save_marks() = 0;

// Printing
virtual const char* name() const = 0;
virtual const char* short_name() const = 0;

// Iteration.

// Iterate over all objects in the generation, calling "cl.do_object" on
// each.
virtual void object_iterate(ObjectClosure* cl);

// Block abstraction.

// Returns the address of the start of the "block" that contains the
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/gc/shared/vmStructs_gc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@
\
declare_constant(Generation::DefNew) \
declare_constant(Generation::MarkSweepCompact) \
declare_constant(Generation::Other) \
\
declare_constant(Generation::LogOfGenGrain) \
declare_constant(Generation::GenGrain) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public abstract class Generation extends VMObject {
private static int NAME_DEF_NEW;
private static int NAME_PAR_NEW;
private static int NAME_MARK_SWEEP_COMPACT;
private static int NAME_OTHER;

static {
VM.registerVMInitializedObserver(new Observer() {
Expand All @@ -80,7 +79,6 @@ private static synchronized void initialize(TypeDataBase db) {
// constants from Generation::Name
NAME_DEF_NEW = db.lookupIntConstant("Generation::DefNew").intValue();
NAME_MARK_SWEEP_COMPACT = db.lookupIntConstant("Generation::MarkSweepCompact").intValue();
NAME_OTHER = db.lookupIntConstant("Generation::Other").intValue();
}

public Generation(Address addr) {
Expand Down Expand Up @@ -111,8 +109,6 @@ static Generation.Name nameForEnum(int value) {
return Name.DEF_NEW;
} else if (value == NAME_MARK_SWEEP_COMPACT) {
return Name.MARK_SWEEP_COMPACT;
} else if (value == NAME_OTHER) {
return Name.OTHER;
} else {
throw new RuntimeException("should not reach here");
}
Expand Down

1 comment on commit f5e6d11

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.