Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/hotspot/share/classfile/classLoaderData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,6 @@ void ClassLoaderData::initialize_holder(Handle loader_or_mirror) {
void ClassLoaderData::remove_class(Klass* scratch_class) {
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);

// Adjust global class iterator.
ClassLoaderDataGraph::adjust_saved_class(scratch_class);

Klass* prev = nullptr;
for (Klass* k = _klasses; k != nullptr; k = k->next_link()) {
if (k == scratch_class) {
Expand Down Expand Up @@ -620,9 +617,6 @@ void ClassLoaderData::unload() {
if (_jmethod_ids != nullptr) {
Method::clear_jmethod_ids(this);
}

// Clean up global class iterator for compiler
ClassLoaderDataGraph::adjust_saved_class(this);
}

ModuleEntryTable* ClassLoaderData::modules() {
Expand Down
79 changes: 0 additions & 79 deletions src/hotspot/share/classfile/classLoaderDataGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,85 +80,6 @@ void ClassLoaderDataGraph::verify_claimed_marks_cleared(int claim) {
#endif
}

// Class iterator used by the compiler. It gets some number of classes at
// a safepoint to decay invocation counters on the methods.
class ClassLoaderDataGraphKlassIteratorStatic {
ClassLoaderData* _current_loader_data;
Klass* _current_class_entry;
public:

ClassLoaderDataGraphKlassIteratorStatic() : _current_loader_data(nullptr), _current_class_entry(nullptr) {}

InstanceKlass* try_get_next_class() {
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
size_t max_classes = ClassLoaderDataGraph::num_instance_classes();
assert(max_classes > 0, "should not be called with no instance classes");
for (size_t i = 0; i < max_classes; ) {

if (_current_class_entry != nullptr) {
Klass* k = _current_class_entry;
_current_class_entry = _current_class_entry->next_link();

if (k->is_instance_klass()) {
InstanceKlass* ik = InstanceKlass::cast(k);
i++; // count all instance classes found
// Not yet loaded classes are counted in max_classes
// but only return loaded classes.
if (ik->is_loaded()) {
return ik;
}
}
} else {
// Go to next CLD
if (_current_loader_data != nullptr) {
_current_loader_data = _current_loader_data->next();
}
// Start at the beginning
if (_current_loader_data == nullptr) {
_current_loader_data = ClassLoaderDataGraph::_head;
}

_current_class_entry = _current_loader_data->klasses();
}
}
// Should never be reached unless all instance classes have failed or are not fully loaded.
// Caller handles null.
return nullptr;
}

// If the current class for the static iterator is a class being unloaded or
// deallocated, adjust the current class.
void adjust_saved_class(ClassLoaderData* cld) {
if (_current_loader_data == cld) {
_current_loader_data = cld->next();
if (_current_loader_data != nullptr) {
_current_class_entry = _current_loader_data->klasses();
} // else try_get_next_class will start at the head
}
}

void adjust_saved_class(Klass* klass) {
if (_current_class_entry == klass) {
_current_class_entry = klass->next_link();
}
}
};

static ClassLoaderDataGraphKlassIteratorStatic static_klass_iterator;

InstanceKlass* ClassLoaderDataGraph::try_get_next_class() {
assert(SafepointSynchronize::is_at_safepoint(), "only called at safepoint");
return static_klass_iterator.try_get_next_class();
}

void ClassLoaderDataGraph::adjust_saved_class(ClassLoaderData* cld) {
return static_klass_iterator.adjust_saved_class(cld);
}

void ClassLoaderDataGraph::adjust_saved_class(Klass* klass) {
return static_klass_iterator.adjust_saved_class(klass);
}

void ClassLoaderDataGraph::clean_deallocate_lists(bool walk_previous_versions) {
assert(SafepointSynchronize::is_at_safepoint(), "must only be called at safepoint");
uint loaders_processed = 0;
Expand Down
5 changes: 0 additions & 5 deletions src/hotspot/share/classfile/classLoaderDataGraph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,6 @@ class ClassLoaderDataGraph : public AllStatic {
// Called from VMOperation
static void walk_metadata_and_clean_metaspaces();

// VM_CounterDecay iteration support
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, nice, I think this was removed with the sweeper.

There's also a function InvocationCounter::decay() that can also be removed (maybe more but that's what I found for now).

static InstanceKlass* try_get_next_class();
static void adjust_saved_class(ClassLoaderData* cld);
static void adjust_saved_class(Klass* klass);

static void verify_dictionary();
static void print_dictionary(outputStream* st);
static void print_table_statistics(outputStream* st);
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/share/interpreter/invocationCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ void InvocationCounter::reset() {
update(0);
}

void InvocationCounter::decay() {
update(count() >> 1);
}

void InvocationCounter::print() {
uint counter = raw_counter();
tty->print_cr("invocation count: up = %d, limit = " INTX_FORMAT ", carry = %s",
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/interpreter/invocationCounter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class InvocationCounter {
// Manipulation
void reset();
void init();
void decay(); // decay counter (divide by two)
void set_carry_on_overflow();
void set(uint count);
void increment() { _counter += count_increment; }
Expand Down