mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
6354181: nsk.logging.stress.threads.scmhml001 fails assertion in "src/share/vm/oops/instanceKlass.cpp, 111"
Reviewed-by: jrose, acorn
This commit is contained in:
parent
7b4f8073f0
commit
f78d8f1157
4 changed files with 23 additions and 8 deletions
|
@ -412,13 +412,16 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
|
|||
fail_type = _unloaded_ciinstance_klass;
|
||||
}
|
||||
KlassHandle found_klass;
|
||||
{
|
||||
MutexLocker ml(Compile_lock);
|
||||
klassOop kls;
|
||||
if (!require_local) {
|
||||
klassOop kls = SystemDictionary::find_constrained_instance_or_array_klass(
|
||||
sym, loader, KILL_COMPILE_ON_FATAL_(fail_type));
|
||||
found_klass = KlassHandle(THREAD, kls);
|
||||
kls = SystemDictionary::find_constrained_instance_or_array_klass(sym, loader,
|
||||
KILL_COMPILE_ON_FATAL_(fail_type));
|
||||
} else {
|
||||
klassOop kls = SystemDictionary::find_instance_or_array_klass(
|
||||
sym, loader, domain, KILL_COMPILE_ON_FATAL_(fail_type));
|
||||
kls = SystemDictionary::find_instance_or_array_klass(sym, loader, domain,
|
||||
KILL_COMPILE_ON_FATAL_(fail_type));
|
||||
}
|
||||
found_klass = KlassHandle(THREAD, kls);
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,7 @@ ciInstanceKlass::ciInstanceKlass(KlassHandle h_k) :
|
|||
ciKlass(h_k), _non_static_fields(NULL)
|
||||
{
|
||||
assert(get_Klass()->oop_is_instance(), "wrong type");
|
||||
assert(get_instanceKlass()->is_loaded(), "must be at least loaded");
|
||||
instanceKlass* ik = get_instanceKlass();
|
||||
|
||||
AccessFlags access_flags = ik->access_flags();
|
||||
|
|
|
@ -322,8 +322,14 @@ bool LoaderConstraintTable::check_or_update(instanceKlassHandle k,
|
|||
klassOop LoaderConstraintTable::find_constrained_klass(Symbol* name,
|
||||
Handle loader) {
|
||||
LoaderConstraintEntry *p = *(find_loader_constraint(name, loader));
|
||||
if (p != NULL && p->klass() != NULL)
|
||||
if (p != NULL && p->klass() != NULL) {
|
||||
if (Klass::cast(p->klass())->oop_is_instance() && !instanceKlass::cast(p->klass())->is_loaded()) {
|
||||
// Only return fully loaded classes. Classes found through the
|
||||
// constraints might still be in the process of loading.
|
||||
return NULL;
|
||||
}
|
||||
return p->klass();
|
||||
}
|
||||
|
||||
// No constraints, or else no klass loaded yet.
|
||||
return NULL;
|
||||
|
|
|
@ -1690,6 +1690,8 @@ klassOop SystemDictionary::try_get_next_class() {
|
|||
|
||||
void SystemDictionary::add_to_hierarchy(instanceKlassHandle k, TRAPS) {
|
||||
assert(k.not_null(), "just checking");
|
||||
assert_locked_or_safepoint(Compile_lock);
|
||||
|
||||
// Link into hierachy. Make sure the vtables are initialized before linking into
|
||||
k->append_to_sibling_list(); // add to superklass/sibling list
|
||||
k->process_interfaces(THREAD); // handle all "implements" declarations
|
||||
|
@ -2152,6 +2154,9 @@ void SystemDictionary::update_dictionary(int d_index, unsigned int d_hash,
|
|||
}
|
||||
|
||||
|
||||
// Try to find a class name using the loader constraints. The
|
||||
// loader constraints might know about a class that isn't fully loaded
|
||||
// yet and these will be ignored.
|
||||
klassOop SystemDictionary::find_constrained_instance_or_array_klass(
|
||||
Symbol* class_name, Handle class_loader, TRAPS) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue