Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8274858: Remove unused dictionary_classes_do functions
Reviewed-by: dholmes, hseigel
  • Loading branch information
coleenp committed Oct 7, 2021
1 parent 03a8d34 commit 4ab274a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 29 deletions.
17 changes: 1 addition & 16 deletions src/hotspot/share/classfile/classLoaderDataGraph.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -426,21 +426,6 @@ void ClassLoaderDataGraph::classes_unloading_do(void f(Klass* const)) {
while (ClassLoaderData* X = iter.get_next()) \
if (X->dictionary() != NULL)

// Walk classes in the loaded class dictionaries in various forms.
// Only walks the classes defined in this class loader.
void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*)) {
FOR_ALL_DICTIONARY(cld) {
cld->dictionary()->classes_do(f);
}
}

// Only walks the classes defined in this class loader.
void ClassLoaderDataGraph::dictionary_classes_do(void f(InstanceKlass*, TRAPS), TRAPS) {
FOR_ALL_DICTIONARY(cld) {
cld->dictionary()->classes_do(f, CHECK);
}
}

void ClassLoaderDataGraph::verify_dictionary() {
FOR_ALL_DICTIONARY(cld) {
cld->dictionary()->verify();
Expand Down
7 changes: 0 additions & 7 deletions src/hotspot/share/classfile/classLoaderDataGraph.hpp
Expand Up @@ -96,13 +96,6 @@ class ClassLoaderDataGraph : public AllStatic {
// Called from VMOperation
static void walk_metadata_and_clean_metaspaces();

// dictionary do
// Iterate over all klasses in dictionary, but
// just the classes from defining class loaders.
static void dictionary_classes_do(void f(InstanceKlass*));
// Added for initialize_itable_for_klass to handle exceptions.
static void dictionary_classes_do(void f(InstanceKlass*, TRAPS), TRAPS);

// VM_CounterDecay iteration support
static InstanceKlass* try_get_next_class();
static void adjust_saved_class(ClassLoaderData* cld);
Expand Down
17 changes: 11 additions & 6 deletions src/hotspot/share/memory/universe.cpp
Expand Up @@ -523,15 +523,20 @@ static void reinitialize_vtables() {
}
}

static void reinitialize_itables() {

static void initialize_itable_for_klass(InstanceKlass* k) {
k->itable().initialize_itable();
}

class ReinitTableClosure : public KlassClosure {
public:
void do_klass(Klass* k) {
if (k->is_instance_klass()) {
InstanceKlass::cast(k)->itable().initialize_itable();
}
}
};

static void reinitialize_itables() {
MutexLocker mcld(ClassLoaderDataGraph_lock);
ClassLoaderDataGraph::dictionary_classes_do(initialize_itable_for_klass);
ReinitTableClosure cl;
ClassLoaderDataGraph::classes_do(&cl);
}


Expand Down

1 comment on commit 4ab274a

@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.