8237750: Load libzip.so only if necessary

Libzip.so is unconditionally loaded even without usage. Fix by on demand loading.

Reviewed-by: dlong, iklam, ccheung
This commit is contained in:
Yumin Qi 2020-05-05 15:40:18 -07:00
parent bc8065facd
commit 0c0d485c37
6 changed files with 28 additions and 4 deletions

View file

@ -252,6 +252,11 @@ class ClassLoader: AllStatic {
static void load_zip_library();
static void load_jimage_library();
private:
static int _libzip_loaded; // used to sync loading zip.
static void release_load_zip_library();
static inline void load_zip_library_if_needed();
public:
static ClassPathEntry* create_class_path_entry(const char *path, const struct stat* st,
bool throw_exception,