提交 55793d0d 编写于 作者: N never

6354181: nsk.logging.stress.threads.scmhml001 fails assertion in...

6354181: nsk.logging.stress.threads.scmhml001 fails assertion in "src/share/vm/oops/instanceKlass.cpp, 111"
Reviewed-by: jrose, acorn
上级 4994604f
......@@ -412,13 +412,16 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
fail_type = _unloaded_ciinstance_klass;
}
KlassHandle found_klass;
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);
} else {
klassOop kls = SystemDictionary::find_instance_or_array_klass(
sym, loader, domain, KILL_COMPILE_ON_FATAL_(fail_type));
{
MutexLocker ml(Compile_lock);
klassOop kls;
if (!require_local) {
kls = SystemDictionary::find_constrained_instance_or_array_klass(sym, loader,
KILL_COMPILE_ON_FATAL_(fail_type));
} else {
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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册