< prev index next >

test/testlibrary/whitebox/sun/hotspot/WhiteBox.java

Print this page




  59   public synchronized static WhiteBox getWhiteBox() {
  60     SecurityManager sm = System.getSecurityManager();
  61     if (sm != null) {
  62       sm.checkPermission(new WhiteBoxPermission("getInstance"));
  63     }
  64     return instance;
  65   }
  66 
  67   static {
  68     registerNatives();
  69   }
  70 
  71   // Get the maximum heap size supporting COOPs
  72   public native long getCompressedOopsMaxHeapSize();
  73   // Arguments
  74   public native void printHeapSizes();
  75 
  76   // Memory
  77   public native long getObjectAddress(Object o);
  78   public native int  getHeapOopSize();

  79   public native int  getVMPageSize();
  80   public native long getVMLargePageSize();
  81 
  82   public native boolean isObjectInOldGen(Object o);
  83   public native long getObjectSize(Object o);
  84 
  85   // Runtime
  86   // Make sure class name is in the correct format
  87   public boolean isClassAlive(String name) {
  88     return isClassAlive0(name.replace('.', '/'));
  89   }
  90   private native boolean isClassAlive0(String name);
  91   public native boolean isMonitorInflated(Object obj);
  92   public native void forceSafepoint();
  93 
  94   // Resource/Class Lookup Cache
  95   public native boolean classKnownToNotExist(ClassLoader loader, String name);
  96   public native URL[] getLookupCacheURLs(ClassLoader loader);
  97   public native int[] getLookupCacheMatches(ClassLoader loader, String name);
  98 


 143   public        void    makeMethodNotCompilable(Executable method) {
 144     makeMethodNotCompilable(method, -1 /*any*/);
 145   }
 146   public        void    makeMethodNotCompilable(Executable method, int compLevel) {
 147     makeMethodNotCompilable(method, compLevel, false /*not osr*/);
 148   }
 149   public native void    makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr);
 150   public        int     getMethodCompilationLevel(Executable method) {
 151     return getMethodCompilationLevel(method, false /*not ost*/);
 152   }
 153   public native int     getMethodCompilationLevel(Executable method, boolean isOsr);
 154   public native boolean testSetDontInlineMethod(Executable method, boolean value);
 155   public        int     getCompileQueuesSize() {
 156     return getCompileQueueSize(-1 /*any*/);
 157   }
 158   public native int     getCompileQueueSize(int compLevel);
 159   public native boolean testSetForceInlineMethod(Executable method, boolean value);
 160   public        boolean enqueueMethodForCompilation(Executable method, int compLevel) {
 161     return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
 162   }
 163   public native boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci);





 164   public native void    clearMethodState(Executable method);
 165   public native void    markMethodProfiled(Executable method);
 166   public native int     getMethodEntryBci(Executable method);
 167   public native Object[] getNMethod(Executable method, boolean isOsr);
 168 
 169   // Intered strings
 170   public native boolean isInStringTable(String str);
 171 
 172   // Memory
 173   public native void readReservedMemory();



 174   public native long allocateMetaspace(ClassLoader classLoader, long size);
 175   public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
 176   public native long incMetaspaceCapacityUntilGC(long increment);
 177   public native long metaspaceCapacityUntilGC();
 178 
 179   // Force Young GC
 180   public native void youngGC();
 181 
 182   // Force Full GC
 183   public native void fullGC();
 184 
 185   // Method tries to start concurrent mark cycle.
 186   // It returns false if CM Thread is always in concurrent cycle.
 187   public native boolean g1StartConcMarkCycle();
 188 
 189   // Tests on ReservedSpace/VirtualSpace classes
 190   public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations);
 191   public native void runMemoryUnitTests();
 192   public native void readFromNoaccessArea();
 193   public native long getThreadStackSize();




  59   public synchronized static WhiteBox getWhiteBox() {
  60     SecurityManager sm = System.getSecurityManager();
  61     if (sm != null) {
  62       sm.checkPermission(new WhiteBoxPermission("getInstance"));
  63     }
  64     return instance;
  65   }
  66 
  67   static {
  68     registerNatives();
  69   }
  70 
  71   // Get the maximum heap size supporting COOPs
  72   public native long getCompressedOopsMaxHeapSize();
  73   // Arguments
  74   public native void printHeapSizes();
  75 
  76   // Memory
  77   public native long getObjectAddress(Object o);
  78   public native int  getHeapOopSize();
  79   public native long getHeapAlignment();
  80   public native int  getVMPageSize();
  81   public native long getVMLargePageSize();
  82 
  83   public native boolean isObjectInOldGen(Object o);
  84   public native long getObjectSize(Object o);
  85 
  86   // Runtime
  87   // Make sure class name is in the correct format
  88   public boolean isClassAlive(String name) {
  89     return isClassAlive0(name.replace('.', '/'));
  90   }
  91   private native boolean isClassAlive0(String name);
  92   public native boolean isMonitorInflated(Object obj);
  93   public native void forceSafepoint();
  94 
  95   // Resource/Class Lookup Cache
  96   public native boolean classKnownToNotExist(ClassLoader loader, String name);
  97   public native URL[] getLookupCacheURLs(ClassLoader loader);
  98   public native int[] getLookupCacheMatches(ClassLoader loader, String name);
  99 


 144   public        void    makeMethodNotCompilable(Executable method) {
 145     makeMethodNotCompilable(method, -1 /*any*/);
 146   }
 147   public        void    makeMethodNotCompilable(Executable method, int compLevel) {
 148     makeMethodNotCompilable(method, compLevel, false /*not osr*/);
 149   }
 150   public native void    makeMethodNotCompilable(Executable method, int compLevel, boolean isOsr);
 151   public        int     getMethodCompilationLevel(Executable method) {
 152     return getMethodCompilationLevel(method, false /*not ost*/);
 153   }
 154   public native int     getMethodCompilationLevel(Executable method, boolean isOsr);
 155   public native boolean testSetDontInlineMethod(Executable method, boolean value);
 156   public        int     getCompileQueuesSize() {
 157     return getCompileQueueSize(-1 /*any*/);
 158   }
 159   public native int     getCompileQueueSize(int compLevel);
 160   public native boolean testSetForceInlineMethod(Executable method, boolean value);
 161   public        boolean enqueueMethodForCompilation(Executable method, int compLevel) {
 162     return enqueueMethodForCompilation(method, compLevel, -1 /*InvocationEntryBci*/);
 163   }
 164   public boolean enqueueMethodForCompilation(Executable method, int compLevel, int entry_bci) {
 165     return enqueueMethodForCompilation0(method, compLevel, entry_bci);
 166   }
 167 
 168   public native boolean enqueueInitializerForCompilation0(Class clazz, int compLevel);
 169   public native boolean enqueueMethodForCompilation0(Executable method, int compLevel, int entry_bci);
 170   public native void    clearMethodState(Executable method);
 171   public native void    markMethodProfiled(Executable method);
 172   public native int     getMethodEntryBci(Executable method);
 173   public native Object[] getNMethod(Executable method, boolean isOsr);
 174 
 175   // Intered strings
 176   public native boolean isInStringTable(String str);
 177 
 178   // Memory
 179   public native void readReservedMemory();
 180   public native long allocateCodeBlob(int size, int blobType);
 181   public native void freeCodeBlob(long address);
 182   public native Object[] getCodeBlob(long address);
 183   public native long allocateMetaspace(ClassLoader classLoader, long size);
 184   public native void freeMetaspace(ClassLoader classLoader, long addr, long size);
 185   public native long incMetaspaceCapacityUntilGC(long increment);
 186   public native long metaspaceCapacityUntilGC();
 187 
 188   // Force Young GC
 189   public native void youngGC();
 190 
 191   // Force Full GC
 192   public native void fullGC();
 193 
 194   // Method tries to start concurrent mark cycle.
 195   // It returns false if CM Thread is always in concurrent cycle.
 196   public native boolean g1StartConcMarkCycle();
 197 
 198   // Tests on ReservedSpace/VirtualSpace classes
 199   public native int stressVirtualSpaceResize(long reservedSpaceSize, long magnitude, long iterations);
 200   public native void runMemoryUnitTests();
 201   public native void readFromNoaccessArea();
 202   public native long getThreadStackSize();


< prev index next >