8240204: Optimize package handling for archived classes

ClassLoader::add_package just sets classpath_index to PackageEntry, moved the code to InstanceKlass. Also avoid calling check_prohibited_package since CDS does not archive prohibited classe in set_package.

Reviewed-by: hseigel, lfoltan, redestad, iklam
This commit is contained in:
Yumin Qi 2020-04-20 16:36:15 -07:00
parent 8da1ee7833
commit 7b8c373494
6 changed files with 34 additions and 45 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -94,7 +94,7 @@ InstanceKlass* KlassFactory::check_shared_class_file_load_hook(
}
if (class_loader.is_null()) {
ClassLoader::add_package(new_ik, path_index, THREAD);
new_ik->set_classpath_index(path_index, THREAD);
}
return new_ik;