Skip to content

Commit dfddbca

Browse files
committed
8341916: Remove ProtectionDomain related hotspot code and tests
Reviewed-by: dholmes, iklam, jrose
1 parent 5eb0733 commit dfddbca

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+169
-1415
lines changed

src/hotspot/share/cds/aotConstantPoolResolver.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,7 @@ void AOTConstantPoolResolver::dumptime_resolve_constants(InstanceKlass* ik, TRAP
170170
Klass* AOTConstantPoolResolver::find_loaded_class(Thread* current, oop class_loader, Symbol* name) {
171171
HandleMark hm(current);
172172
Handle h_loader(current, class_loader);
173-
Klass* k = SystemDictionary::find_instance_or_array_klass(current, name,
174-
h_loader,
175-
Handle());
173+
Klass* k = SystemDictionary::find_instance_or_array_klass(current, name, h_loader);
176174
if (k != nullptr) {
177175
return k;
178176
}

src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void AOTLinkedClassBulkLoader::load_hidden_class(ClassLoaderData* loader_data, I
306306
// use any special ClassLoaderData.
307307
Handle loader(THREAD, loader_data->class_loader());
308308
ResourceMark rm(THREAD);
309-
assert(SystemDictionary::resolve_or_null(ik->name(), loader, pd, THREAD) == nullptr,
309+
assert(SystemDictionary::resolve_or_null(ik->name(), loader, THREAD) == nullptr,
310310
"hidden classes cannot be accessible by name: %s", ik->external_name());
311311
if (HAS_PENDING_EXCEPTION) {
312312
CLEAR_PENDING_EXCEPTION;

src/hotspot/share/cds/classListParser.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,7 @@ void ClassListParser::resolve_indy_impl(Symbol* class_name_symbol, TRAPS) {
612612
// resolve the CP entry for the invokedynamic instruction, which may result in
613613
// generation of LambdaForm classes.
614614
Handle class_loader(THREAD, SystemDictionary::java_system_loader());
615-
Handle protection_domain;
616-
Klass* klass = SystemDictionary::resolve_or_fail(class_name_symbol, class_loader, protection_domain, true, CHECK);
615+
Klass* klass = SystemDictionary::resolve_or_fail(class_name_symbol, class_loader, true, CHECK);
617616
if (klass->is_instance_klass()) {
618617
InstanceKlass* ik = InstanceKlass::cast(klass);
619618
MetaspaceShared::try_link_class(THREAD, ik);
@@ -781,8 +780,7 @@ InstanceKlass* ClassListParser::lookup_interface_for_current_class(Symbol* inter
781780

782781
InstanceKlass* ClassListParser::find_builtin_class_helper(JavaThread* current, Symbol* class_name_symbol, oop class_loader_oop) {
783782
Handle class_loader(current, class_loader_oop);
784-
Handle protection_domain;
785-
return SystemDictionary::find_instance_klass(current, class_name_symbol, class_loader, protection_domain);
783+
return SystemDictionary::find_instance_klass(current, class_name_symbol, class_loader);
786784
}
787785

788786
InstanceKlass* ClassListParser::find_builtin_class(JavaThread* current, const char* class_name) {

src/hotspot/share/cds/heapShared.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2436,7 +2436,7 @@ void HeapShared::print_stats() {
24362436

24372437
bool HeapShared::is_archived_boot_layer_available(JavaThread* current) {
24382438
TempNewSymbol klass_name = SymbolTable::new_symbol(ARCHIVED_BOOT_LAYER_CLASS);
2439-
InstanceKlass* k = SystemDictionary::find_instance_klass(current, klass_name, Handle(), Handle());
2439+
InstanceKlass* k = SystemDictionary::find_instance_klass(current, klass_name, Handle());
24402440
if (k == nullptr) {
24412441
return false;
24422442
} else {

src/hotspot/share/ci/ciEnv.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -462,14 +462,12 @@ ciKlass* ciEnv::get_klass_by_name_impl(ciKlass* accessing_klass,
462462
}
463463

464464
Handle loader;
465-
Handle domain;
466465
if (accessing_klass != nullptr) {
467466
loader = Handle(current, accessing_klass->loader());
468-
domain = Handle(current, accessing_klass->protection_domain());
469467
}
470468

471469
Klass* found_klass = require_local ?
472-
SystemDictionary::find_instance_or_array_klass(current, sym, loader, domain) :
470+
SystemDictionary::find_instance_or_array_klass(current, sym, loader) :
473471
SystemDictionary::find_constrained_instance_or_array_klass(current, sym, loader);
474472

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

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

16181615
for (int i = 0; i < objects->length(); i++) {

src/hotspot/share/ci/ciReplay.cpp

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,6 @@ class CompileReplay : public StackObj {
114114
private:
115115
FILE* _stream;
116116
Thread* _thread;
117-
Handle _protection_domain;
118-
bool _protection_domain_initialized;
119117
Handle _loader;
120118
int _version;
121119

@@ -144,8 +142,6 @@ class CompileReplay : public StackObj {
144142
CompileReplay(const char* filename, TRAPS) {
145143
_thread = THREAD;
146144
_loader = Handle(_thread, SystemDictionary::java_system_loader());
147-
_protection_domain = Handle();
148-
_protection_domain_initialized = false;
149145

150146
_stream = os::fopen(filename, "rt");
151147
if (_stream == nullptr) {
@@ -558,7 +554,7 @@ class CompileReplay : public StackObj {
558554
if (_iklass != nullptr) {
559555
k = (Klass*)_iklass->find_klass(ciSymbol::make(klass_name->as_C_string()))->constant_encoding();
560556
} else {
561-
k = SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
557+
k = SystemDictionary::resolve_or_fail(klass_name, _loader, true, THREAD);
562558
}
563559
if (HAS_PENDING_EXCEPTION) {
564560
oop throwable = PENDING_EXCEPTION;
@@ -579,7 +575,7 @@ class CompileReplay : public StackObj {
579575
// Lookup a klass
580576
Klass* resolve_klass(const char* klass, TRAPS) {
581577
Symbol* klass_name = SymbolTable::new_symbol(klass);
582-
return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
578+
return SystemDictionary::resolve_or_fail(klass_name, _loader, true, THREAD);
583579
}
584580

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

899-
if (_version >= 1) {
900-
if (!_protection_domain_initialized && k != nullptr) {
901-
assert(_protection_domain() == nullptr, "must be uninitialized");
902-
// The first entry is the holder class of the method for which a replay compilation is requested.
903-
// Use the same protection domain to load all subsequent classes in order to resolve all classes
904-
// in signatures of inlinees. This ensures that inlining can be done as stated in the replay file.
905-
_protection_domain = Handle(_thread, k->protection_domain());
906-
}
907-
908-
_protection_domain_initialized = true;
909-
}
910-
911895
if (k == nullptr) {
912896
return;
913897
}

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,6 @@ void ClassFileParser::parse_interfaces(const ClassFileStream* const stream,
822822
interf = SystemDictionary::resolve_super_or_fail(_class_name,
823823
unresolved_klass,
824824
Handle(THREAD, _loader_data->class_loader()),
825-
_protection_domain,
826825
false, CHECK);
827826
}
828827

@@ -5691,7 +5690,6 @@ void ClassFileParser::post_process_parsed_stream(const ClassFileStream* const st
56915690
SystemDictionary::resolve_super_or_fail(_class_name,
56925691
super_class_name,
56935692
loader,
5694-
_protection_domain,
56955693
true,
56965694
CHECK);
56975695
}

0 commit comments

Comments
 (0)