diff src/share/vm/classfile/classLoader.cpp @ 1980:828eafbd85cc

6348631: remove the use of the HPI library from Hotspot Summary: move functions from hpi library to hotspot, communicate with licensees and open source community, check jdk for dependency, file CCC request Reviewed-by: coleenp, acorn, dsamersoff
author ikrylov
date Wed, 01 Dec 2010 18:26:32 -0500
parents f95d63e2154a
children 06f017f7daa7 75efcee5ac47
line wrap: on
line diff
--- a/src/share/vm/classfile/classLoader.cpp	Tue Nov 23 13:22:55 2010 -0800
+++ b/src/share/vm/classfile/classLoader.cpp	Wed Dec 01 18:26:32 2010 -0500
@@ -48,7 +48,6 @@
 #include "runtime/fprofiler.hpp"
 #include "runtime/handles.hpp"
 #include "runtime/handles.inline.hpp"
-#include "runtime/hpi.hpp"
 #include "runtime/init.hpp"
 #include "runtime/interfaceSupport.hpp"
 #include "runtime/java.hpp"
@@ -61,15 +60,12 @@
 #include "utilities/hashtable.hpp"
 #include "utilities/hashtable.inline.hpp"
 #ifdef TARGET_OS_FAMILY_linux
-# include "hpi_linux.hpp"
 # include "os_linux.inline.hpp"
 #endif
 #ifdef TARGET_OS_FAMILY_solaris
-# include "hpi_solaris.hpp"
 # include "os_solaris.inline.hpp"
 #endif
 #ifdef TARGET_OS_FAMILY_windows
-# include "hpi_windows.hpp"
 # include "os_windows.inline.hpp"
 #endif
 
@@ -208,13 +204,13 @@
   struct stat st;
   if (os::stat(path, &st) == 0) {
     // found file, open it
-    int file_handle = hpi::open(path, 0, 0);
+    int file_handle = os::open(path, 0, 0);
     if (file_handle != -1) {
       // read contents into resource array
       u1* buffer = NEW_RESOURCE_ARRAY(u1, st.st_size);
       size_t num_read = os::read(file_handle, (char*) buffer, st.st_size);
       // close file
-      hpi::close(file_handle);
+      os::close(file_handle);
       // construct ClassFileStream
       if (num_read == (size_t)st.st_size) {
         if (UsePerfData) {
@@ -607,18 +603,18 @@
   // Load zip library
   char path[JVM_MAXPATHLEN];
   char ebuf[1024];
-  hpi::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip");
-  void* handle = hpi::dll_load(path, ebuf, sizeof ebuf);
+  os::dll_build_name(path, sizeof(path), Arguments::get_dll_dir(), "zip");
+  void* handle = os::dll_load(path, ebuf, sizeof ebuf);
   if (handle == NULL) {
     vm_exit_during_initialization("Unable to load ZIP library", path);
   }
   // Lookup zip entry points
-  ZipOpen      = CAST_TO_FN_PTR(ZipOpen_t, hpi::dll_lookup(handle, "ZIP_Open"));
-  ZipClose     = CAST_TO_FN_PTR(ZipClose_t, hpi::dll_lookup(handle, "ZIP_Close"));
-  FindEntry    = CAST_TO_FN_PTR(FindEntry_t, hpi::dll_lookup(handle, "ZIP_FindEntry"));
-  ReadEntry    = CAST_TO_FN_PTR(ReadEntry_t, hpi::dll_lookup(handle, "ZIP_ReadEntry"));
-  ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, hpi::dll_lookup(handle, "ZIP_ReadMappedEntry"));
-  GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, hpi::dll_lookup(handle, "ZIP_GetNextEntry"));
+  ZipOpen      = CAST_TO_FN_PTR(ZipOpen_t, os::dll_lookup(handle, "ZIP_Open"));
+  ZipClose     = CAST_TO_FN_PTR(ZipClose_t, os::dll_lookup(handle, "ZIP_Close"));
+  FindEntry    = CAST_TO_FN_PTR(FindEntry_t, os::dll_lookup(handle, "ZIP_FindEntry"));
+  ReadEntry    = CAST_TO_FN_PTR(ReadEntry_t, os::dll_lookup(handle, "ZIP_ReadEntry"));
+  ReadMappedEntry = CAST_TO_FN_PTR(ReadMappedEntry_t, os::dll_lookup(handle, "ZIP_ReadMappedEntry"));
+  GetNextEntry = CAST_TO_FN_PTR(GetNextEntry_t, os::dll_lookup(handle, "ZIP_GetNextEntry"));
 
   // ZIP_Close is not exported on Windows in JDK5.0 so don't abort if ZIP_Close is NULL
   if (ZipOpen == NULL || FindEntry == NULL || ReadEntry == NULL || GetNextEntry == NULL) {
@@ -627,7 +623,7 @@
 
   // Lookup canonicalize entry in libjava.dll
   void *javalib_handle = os::native_java_library();
-  CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, hpi::dll_lookup(javalib_handle, "Canonicalize"));
+  CanonicalizeEntry = CAST_TO_FN_PTR(canonicalize_fn_t, os::dll_lookup(javalib_handle, "Canonicalize"));
   // This lookup only works on 1.3. Do not check for non-null here
 }
 
@@ -1076,7 +1072,7 @@
   assert(orig != NULL && out != NULL && len > 0, "bad arguments");
   if (CanonicalizeEntry != NULL) {
     JNIEnv* env = JavaThread::current()->jni_environment();
-    if ((CanonicalizeEntry)(env, hpi::native_path(orig), out, len) < 0) {
+    if ((CanonicalizeEntry)(env, os::native_path(orig), out, len) < 0) {
       return false;
     }
   } else {