Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/hotspot/share/cds/aotConstantPoolResolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ void AOTConstantPoolResolver::dumptime_resolve_constants(InstanceKlass* ik, TRAP
Klass* AOTConstantPoolResolver::find_loaded_class(Thread* current, oop class_loader, Symbol* name) {
HandleMark hm(current);
Handle h_loader(current, class_loader);
Klass* k = SystemDictionary::find_instance_or_array_klass(current, name,
h_loader,
Handle());
Klass* k = SystemDictionary::find_instance_or_array_klass(current, name, h_loader);
if (k != nullptr) {
return k;
}
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void AOTLinkedClassBulkLoader::load_hidden_class(ClassLoaderData* loader_data, I
// use any special ClassLoaderData.
Handle loader(THREAD, loader_data->class_loader());
ResourceMark rm(THREAD);
assert(SystemDictionary::resolve_or_null(ik->name(), loader, pd, THREAD) == nullptr,
assert(SystemDictionary::resolve_or_null(ik->name(), loader, THREAD) == nullptr,
"hidden classes cannot be accessible by name: %s", ik->external_name());
if (HAS_PENDING_EXCEPTION) {
CLEAR_PENDING_EXCEPTION;
Expand Down
6 changes: 2 additions & 4 deletions src/hotspot/share/cds/classListParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,7 @@ void ClassListParser::resolve_indy_impl(Symbol* class_name_symbol, TRAPS) {
// resolve the CP entry for the invokedynamic instruction, which may result in
// generation of LambdaForm classes.
Handle class_loader(THREAD, SystemDictionary::java_system_loader());
Handle protection_domain;
Klass* klass = SystemDictionary::resolve_or_fail(class_name_symbol, class_loader, protection_domain, true, CHECK);
Klass* klass = SystemDictionary::resolve_or_fail(class_name_symbol, class_loader, true, CHECK);
if (klass->is_instance_klass()) {
InstanceKlass* ik = InstanceKlass::cast(klass);
MetaspaceShared::try_link_class(THREAD, ik);
Expand Down Expand Up @@ -781,8 +780,7 @@ InstanceKlass* ClassListParser::lookup_interface_for_current_class(Symbol* inter

InstanceKlass* ClassListParser::find_builtin_class_helper(JavaThread* current, Symbol* class_name_symbol, oop class_loader_oop) {
Handle class_loader(current, class_loader_oop);
Handle protection_domain;
return SystemDictionary::find_instance_klass(current, class_name_symbol, class_loader, protection_domain);
return SystemDictionary::find_instance_klass(current, class_name_symbol, class_loader);
}

InstanceKlass* ClassListParser::find_builtin_class(JavaThread* current, const char* class_name) {
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/cds/heapShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2436,7 +2436,7 @@ void HeapShared::print_stats() {

bool HeapShared::is_archived_boot_layer_available(JavaThread* current) {
TempNewSymbol klass_name = SymbolTable::new_symbol(ARCHIVED_BOOT_LAYER_CLASS);
InstanceKlass* k = SystemDictionary::find_instance_klass(current, klass_name, Handle(), Handle());
InstanceKlass* k = SystemDictionary::find_instance_klass(current, klass_name, Handle());
if (k == nullptr) {
return false;
} else {
Expand Down
7 changes: 2 additions & 5 deletions src/hotspot/share/ci/ciEnv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,12 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
}

Handle loader;
Handle domain;
if (accessing_klass != nullptr) {
loader = Handle(current, accessing_klass->loader());
domain = Handle(current, accessing_klass->protection_domain());
}

Klass* found_klass = require_local ?
SystemDictionary::find_instance_or_array_klass(current, sym, loader, domain) :
SystemDictionary::find_instance_or_array_klass(current, sym, loader) :
SystemDictionary::find_constrained_instance_or_array_klass(current, sym, loader);

// If we fail to find an array klass, look again for its element type.
Expand Down Expand Up @@ -1611,8 +1609,7 @@ void ciEnv::dump_replay_data_helper(outputStream* out) {
GrowableArray<ciMetadata*>* objects = _factory->get_ci_metadata();
out->print_cr("# %d ciObject found", objects->length());

// The very first entry is the InstanceKlass of the root method of the current compilation in order to get the right
// protection domain to load subsequent classes during replay compilation.
// The very first entry is the InstanceKlass of the root method of the current compilation.
ciInstanceKlass::dump_replay_instanceKlass(out, task()->method()->method_holder());

for (int i = 0; i < objects->length(); i++) {
Expand Down
20 changes: 2 additions & 18 deletions src/hotspot/share/ci/ciReplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ class CompileReplay : public StackObj {
private:
FILE* _stream;
Thread* _thread;
Handle _protection_domain;
bool _protection_domain_initialized;
Handle _loader;
int _version;

Expand Down Expand Up @@ -144,8 +142,6 @@ class CompileReplay : public StackObj {
CompileReplay(const char* filename, TRAPS) {
_thread = THREAD;
_loader = Handle(_thread, SystemDictionary::java_system_loader());
_protection_domain = Handle();
_protection_domain_initialized = false;

_stream = os::fopen(filename, "rt");
if (_stream == nullptr) {
Expand Down Expand Up @@ -558,7 +554,7 @@ class CompileReplay : public StackObj {
if (_iklass != nullptr) {
k = (Klass*)_iklass->find_klass(ciSymbol::make(klass_name->as_C_string()))->constant_encoding();
} else {
k = SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
k = SystemDictionary::resolve_or_fail(klass_name, _loader, true, THREAD);
}
if (HAS_PENDING_EXCEPTION) {
oop throwable = PENDING_EXCEPTION;
Expand All @@ -579,7 +575,7 @@ class CompileReplay : public StackObj {
// Lookup a klass
Klass* resolve_klass(const char* klass, TRAPS) {
Symbol* klass_name = SymbolTable::new_symbol(klass);
return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
return SystemDictionary::resolve_or_fail(klass_name, _loader, true, THREAD);
}

// Parse the standard tuple of <klass> <name> <signature>
Expand Down Expand Up @@ -896,18 +892,6 @@ class CompileReplay : public StackObj {
// just load the referenced class
Klass* k = parse_klass(CHECK);

if (_version >= 1) {
if (!_protection_domain_initialized && k != nullptr) {
assert(_protection_domain() == nullptr, "must be uninitialized");
// The first entry is the holder class of the method for which a replay compilation is requested.
// Use the same protection domain to load all subsequent classes in order to resolve all classes
// in signatures of inlinees. This ensures that inlining can be done as stated in the replay file.
_protection_domain = Handle(_thread, k->protection_domain());
}

_protection_domain_initialized = true;
}

if (k == nullptr) {
return;
}
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/classfile/classFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,6 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
interf = SystemDictionary::resolve_super_or_fail(_class_name,
unresolved_klass,
Handle(THREAD, _loader_data->class_loader()),
_protection_domain,
false, CHECK);
}

Expand Down Expand Up @@ -5691,7 +5690,6 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
SystemDictionary::resolve_super_or_fail(_class_name,
super_class_name,
loader,
_protection_domain,
true,
CHECK);
}
Expand Down
Loading