Skip to content

Commit 2352268

Browse files
author
Markus Grönlund
committedFeb 21, 2024
8326334: JFR failed assert(used(klass)) failed: invariant
Reviewed-by: egahlin
1 parent 492e8bf commit 2352268

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/hotspot/share/jfr/support/jfrKlassUnloading.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -101,13 +101,12 @@ void JfrKlassUnloading::clear() {
101101
}
102102
}
103103

104-
static bool add_to_unloaded_klass_set(traceid klass_id, bool current_epoch) {
104+
static void add_to_unloaded_klass_set(traceid klass_id) {
105105
assert_locked_or_safepoint(ClassLoaderDataGraph_lock);
106-
GrowableArray<traceid>* const unload_set = current_epoch ? get_unload_set() : get_unload_set_previous_epoch();
106+
GrowableArray<traceid>* const unload_set = get_unload_set();
107107
assert(unload_set != nullptr, "invariant");
108108
assert(unload_set->find(klass_id) == -1, "invariant");
109109
unload_set->append(klass_id);
110-
return true;
111110
}
112111

113112
#if INCLUDE_MANAGEMENT
@@ -129,7 +128,8 @@ bool JfrKlassUnloading::on_unload(const Klass* k) {
129128
if (IS_JDK_JFR_EVENT_SUBKLASS(k)) {
130129
++event_klass_unloaded_count;
131130
}
132-
return USED_ANY_EPOCH(k) && add_to_unloaded_klass_set(JfrTraceId::load_raw(k), USED_THIS_EPOCH(k));
131+
add_to_unloaded_klass_set(JfrTraceId::load_raw(k));
132+
return USED_THIS_EPOCH(k);
133133
}
134134

135135
bool JfrKlassUnloading::is_unloaded(traceid klass_id, bool previous_epoch /* false */) {

0 commit comments

Comments
 (0)
Please sign in to comment.