Print this page
rev 6864 : 8061651: Interface to the Lookup Index Cache to improve URLClassPath search time
Summary: Implemented the interface in sun.misc.URLClassPath and corresponding JVM_XXX APIs
Reviewed-by: mchung, acorn, jiangli, dholmes

Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/prims/jvm.cpp
          +++ new/src/share/vm/prims/jvm.cpp
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18   18   *
  19   19   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20   20   * or visit www.oracle.com if you need additional information or have any
  21   21   * questions.
  22   22   *
  23   23   */
  24   24  
  25   25  #include "precompiled.hpp"
  26   26  #include "classfile/classLoader.hpp"
       27 +#include "classfile/classLoaderExt.hpp"
  27   28  #include "classfile/javaAssertions.hpp"
  28   29  #include "classfile/javaClasses.hpp"
  29   30  #include "classfile/symbolTable.hpp"
  30   31  #include "classfile/systemDictionary.hpp"
  31   32  #if INCLUDE_CDS
  32   33  #include "classfile/sharedClassUtil.hpp"
  33   34  #include "classfile/systemDictionaryShared.hpp"
  34   35  #endif
  35   36  #include "classfile/vmSymbols.hpp"
  36   37  #include "gc_interface/collectedHeap.inline.hpp"
↓ open down ↓ 349 lines elided ↑ open up ↑
 386  387      const char* compiler_name = "";
 387  388  #endif // compilers
 388  389  #endif // TIERED
 389  390  
 390  391      if (*compiler_name != '\0' &&
 391  392          (Arguments::mode() != Arguments::_int)) {
 392  393        PUTPROP(props, "sun.management.compiler", compiler_name);
 393  394      }
 394  395    }
 395  396  
      397 +  const char* enableSharedLookupCache = "false";
      398 +#if INCLUDE_CDS
      399 +  if (ClassLoaderExt::is_lookup_cache_enabled()) {
      400 +    enableSharedLookupCache = "true";
      401 +  }
      402 +#endif
      403 +  PUTPROP(props, "sun.cds.enableSharedLookupCache", enableSharedLookupCache);
      404 +
 396  405    return properties;
 397  406  JVM_END
 398  407  
 399  408  
 400  409  /*
 401  410   * Return the temporary directory that the VM uses for the attach
 402  411   * and perf data files.
 403  412   *
 404  413   * It is important that this directory is well-known and the
 405  414   * same for all VM instances. It cannot be affected by configuration
↓ open down ↓ 353 lines elided ↑ open up ↑
 759  768    }
 760  769  JVM_END
 761  770  
 762  771  
 763  772  JVM_ENTRY(void, JVM_ResolveClass(JNIEnv* env, jclass cls))
 764  773    JVMWrapper("JVM_ResolveClass");
 765  774    if (PrintJVMWarnings) warning("JVM_ResolveClass not implemented");
 766  775  JVM_END
 767  776  
 768  777  
      778 +JVM_ENTRY(jboolean, JVM_KnownToNotExist(JNIEnv *env, jobject loader, const char *classname))
      779 +  JVMWrapper("JVM_KnownToNotExist");
      780 +#if INCLUDE_CDS
      781 +  return ClassLoaderExt::known_to_not_exist(env, loader, classname, CHECK_(false));
      782 +#else
      783 +  return false;
      784 +#endif
      785 +JVM_END
      786 +
      787 +
      788 +JVM_ENTRY(jobjectArray, JVM_GetResourceLookupCacheURLs(JNIEnv *env, jobject loader))
      789 +  JVMWrapper("JVM_GetResourceLookupCacheURLs");
      790 +#if INCLUDE_CDS
      791 +  return ClassLoaderExt::get_lookup_cache_urls(env, loader, CHECK_NULL);
      792 +#else
      793 +  return NULL;
      794 +#endif
      795 +JVM_END
      796 +
      797 +
      798 +JVM_ENTRY(jintArray, JVM_GetResourceLookupCache(JNIEnv *env, jobject loader, const char *resource_name))
      799 +  JVMWrapper("JVM_GetResourceLookupCache");
      800 +#if INCLUDE_CDS
      801 +  return ClassLoaderExt::get_lookup_cache(env, loader, resource_name, CHECK_NULL);
      802 +#else
      803 +  return NULL;
      804 +#endif
      805 +JVM_END
      806 +
      807 +
 769  808  // Returns a class loaded by the bootstrap class loader; or null
 770  809  // if not found.  ClassNotFoundException is not thrown.
 771  810  //
 772  811  // Rationale behind JVM_FindClassFromBootLoader
 773  812  // a> JVM_FindClassFromClassLoader was never exported in the export tables.
 774  813  // b> because of (a) java.dll has a direct dependecy on the  unexported
 775  814  //    private symbol "_JVM_FindClassFromClassLoader@20".
 776  815  // c> the launcher cannot use the private symbol as it dynamically opens
 777  816  //    the entry point, so if something changes, the launcher will fail
 778  817  //    unexpectedly at runtime, it is safest for the launcher to dlopen a
↓ open down ↓ 3723 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX