mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8279993: Assert that a shared class is not loaded more than once
Reviewed-by: iklam, stuefe
(cherry picked from commit bb24c36759)
This commit is contained in:
committed by
Vitaly Provodin
parent
aacb764042
commit
c20e192b25
@@ -69,6 +69,7 @@
|
||||
#include "prims/jvmtiExport.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/handles.inline.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
#include "runtime/javaCalls.hpp"
|
||||
@@ -1143,7 +1144,8 @@ InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik,
|
||||
PackageEntry* pkg_entry,
|
||||
TRAPS) {
|
||||
assert(ik != nullptr, "sanity");
|
||||
assert(!ik->is_unshareable_info_restored(), "shared class can be loaded only once");
|
||||
assert(!ik->is_unshareable_info_restored(), "shared class can be restored only once");
|
||||
assert(Atomic::add(&ik->_shared_class_load_count, 1) == 1, "shared class loaded more than once");
|
||||
Symbol* class_name = ik->name();
|
||||
|
||||
if (!is_shared_class_visible(class_name, ik, pkg_entry, class_loader)) {
|
||||
|
||||
@@ -254,6 +254,7 @@ class InstanceKlass: public Klass {
|
||||
#endif
|
||||
|
||||
NOT_PRODUCT(int _verify_count;) // to avoid redundant verifies
|
||||
NOT_PRODUCT(volatile int _shared_class_load_count;) // ensure a shared class is loaded only once
|
||||
|
||||
// Method array.
|
||||
Array<Method*>* _methods;
|
||||
|
||||
Reference in New Issue
Block a user