< prev index next >

src/hotspot/share/classfile/systemDictionary.cpp

Print this page

        

*** 2372,2381 **** --- 2372,2417 ---- } else { return NULL; } } } + + // Add an entry to resolution error table to record an error in resolving or + // validating a nest host. This is used to construct informative error + // messages when IllegalAccessError's occur. If an entry already exists it will + // be updated with the nest host error message. + void SystemDictionary::add_nest_host_error(const constantPoolHandle& pool, + int which, + const char* message) { + unsigned int hash = resolution_errors()->compute_hash(pool, which); + int index = resolution_errors()->hash_to_index(hash); + { + MutexLocker ml(Thread::current(), SystemDictionary_lock); + ResolutionErrorEntry* entry = resolution_errors()->find_entry(index, hash, pool, which); + if (entry != NULL) { + assert(entry->nest_host_error() == NULL, "Nest host error message already set!"); + entry->set_nest_host_error(message); + } else { + resolution_errors()->add_entry(index, hash, pool, which, message); + } + } + } + + // Lookup any nest host error + const char* SystemDictionary::find_nest_host_error(const constantPoolHandle& pool, int which) { + unsigned int hash = resolution_errors()->compute_hash(pool, which); + int index = resolution_errors()->hash_to_index(hash); + { + MutexLocker ml(Thread::current(), SystemDictionary_lock); + ResolutionErrorEntry* entry = resolution_errors()->find_entry(index, hash, pool, which); + if (entry != NULL) { + return entry->nest_host_error(); + } else { + return NULL; + } + } + } // Signature constraints ensure that callers and callees agree about // the meaning of type names in their signatures. This routine is the // intake for constraints. It collects them from several places:
< prev index next >