src/share/vm/aot/aotLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/aot/aotLoader.cpp

src/share/vm/aot/aotLoader.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2016, 2017, 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 * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 25,34 **** --- 25,35 ---- #include "aot/aotCodeHeap.hpp" #include "aot/aotLoader.inline.hpp" #include "jvmci/jvmciRuntime.hpp" #include "oops/method.hpp" + #include "runtime/os.hpp" GrowableArray<AOTCodeHeap*>* AOTLoader::_heaps = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTCodeHeap*> (2, true); GrowableArray<AOTLib*>* AOTLoader::_libraries = new(ResourceObj::C_HEAP, mtCode) GrowableArray<AOTLib*> (2, true); // Iterate over all AOT CodeHeaps
*** 144,160 **** const char* home = Arguments::get_java_home(); const char* file_separator = os::file_separator(); for (int i = 0; i < (int) (sizeof(modules) / sizeof(const char*)); i++) { char library[JVM_MAXPATHLEN]; ! jio_snprintf(library, sizeof(library), "%s%slib%slib%s%s%s.so", home, file_separator, file_separator, modules[i], UseCompressedOops ? "-coop" : "", UseG1GC ? "" : "-nong1"); load_library(library, false); } // Scan the AOTLibrary option. if (AOTLibrary != NULL) { ! const int len = strlen(AOTLibrary); char* cp = NEW_C_HEAP_ARRAY(char, len+1, mtCode); if (cp != NULL) { // No memory? memcpy(cp, AOTLibrary, len); cp[len] = '\0'; char* end = cp + len; --- 145,161 ---- const char* home = Arguments::get_java_home(); const char* file_separator = os::file_separator(); for (int i = 0; i < (int) (sizeof(modules) / sizeof(const char*)); i++) { char library[JVM_MAXPATHLEN]; ! jio_snprintf(library, sizeof(library), "%s%slib%slib%s%s%s%s", home, file_separator, file_separator, modules[i], UseCompressedOops ? "-coop" : "", UseG1GC ? "" : "-nong1", os::dll_file_extension()); load_library(library, false); } // Scan the AOTLibrary option. if (AOTLibrary != NULL) { ! const int len = (int)strlen(AOTLibrary); char* cp = NEW_C_HEAP_ARRAY(char, len+1, mtCode); if (cp != NULL) { // No memory? memcpy(cp, AOTLibrary, len); cp[len] = '\0'; char* end = cp + len;
*** 232,254 **** } } } void AOTLoader::load_library(const char* name, bool exit_on_error) { ! void* handle = dlopen(name, RTLD_LAZY); if (handle == NULL) { if (exit_on_error) { ! tty->print_cr("error opening file: %s", dlerror()); vm_exit(1); } return; } const int dso_id = libraries_count() + 1; AOTLib* lib = new AOTLib(handle, name, dso_id); if (!lib->is_valid()) { delete lib; ! dlclose(handle); return; } add_library(lib); } --- 233,256 ---- } } } void AOTLoader::load_library(const char* name, bool exit_on_error) { ! char ebuf[1024]; ! void* handle = os::dll_load(name, ebuf, sizeof ebuf); if (handle == NULL) { if (exit_on_error) { ! tty->print_cr("error opening file: %s", ebuf); vm_exit(1); } return; } const int dso_id = libraries_count() + 1; AOTLib* lib = new AOTLib(handle, name, dso_id); if (!lib->is_valid()) { delete lib; ! os::dll_unload(handle); return; } add_library(lib); }
src/share/vm/aot/aotLoader.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File