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/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
          +++ new/test/testlibrary/whitebox/sun/hotspot/WhiteBox.java
↓ open down ↓ 22 lines elided ↑ open up ↑
  23   23   */
  24   24  
  25   25  package sun.hotspot;
  26   26  
  27   27  import java.lang.reflect.Executable;
  28   28  import java.util.Arrays;
  29   29  import java.util.List;
  30   30  import java.util.function.Function;
  31   31  import java.util.stream.Stream;
  32   32  import java.security.BasicPermission;
       33 +import java.net.URL;
  33   34  
  34   35  import sun.hotspot.parser.DiagnosticCommand;
  35   36  
  36   37  public class WhiteBox {
  37   38  
  38   39    @SuppressWarnings("serial")
  39   40    public static class WhiteBoxPermission extends BasicPermission {
  40   41      public WhiteBoxPermission(String s) {
  41   42        super(s);
  42   43      }
↓ open down ↓ 34 lines elided ↑ open up ↑
  77   78    public native boolean isObjectInOldGen(Object o);
  78   79    public native long getObjectSize(Object o);
  79   80  
  80   81    // Runtime
  81   82    // Make sure class name is in the correct format
  82   83    public boolean isClassAlive(String name) {
  83   84      return isClassAlive0(name.replace('.', '/'));
  84   85    }
  85   86    private native boolean isClassAlive0(String name);
  86   87  
       88 +  // Resource/Class Lookup Cache
       89 +  public native boolean classKnownToNotExist(ClassLoader loader, String name);
       90 +  public native URL[] getLookupCacheURLs(ClassLoader loader);
       91 +  public native int[] getLookupCacheMatches(ClassLoader loader, String name);
       92 +
  87   93    // G1
  88   94    public native boolean g1InConcurrentMark();
  89   95    public native boolean g1IsHumongous(Object o);
  90   96    public native long    g1NumFreeRegions();
  91   97    public native int     g1RegionSize();
  92   98    public native Object[]    parseCommandLine(String commandline, DiagnosticCommand[] args);
  93   99  
  94  100    // NMT
  95  101    public native long NMTMalloc(long size);
  96  102    public native void NMTFree(long mem);
↓ open down ↓ 109 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX