< prev index next >

src/java.instrument/share/classes/sun/instrument/InstrumentationImpl.java

Print this page
rev 63811 : Make Instrumentation.getObjectSize call the intrinsified Runtime.sizeOf instead of going native


 193         redefineClasses0(mNativeAgent, definitions);
 194     }
 195 
 196     @SuppressWarnings("rawtypes")
 197     public Class[]
 198     getAllLoadedClasses() {
 199         return getAllLoadedClasses0(mNativeAgent);
 200     }
 201 
 202     @SuppressWarnings("rawtypes")
 203     public Class[]
 204     getInitiatedClasses(ClassLoader loader) {
 205         return getInitiatedClasses0(mNativeAgent, loader);
 206     }
 207 
 208     public long
 209     getObjectSize(Object objectToSize) {
 210         if (objectToSize == null) {
 211             throw new NullPointerException("null passed as 'objectToSize' in getObjectSize");
 212         }
 213         return getObjectSize0(mNativeAgent, objectToSize);

 214     }
 215 
 216     public void
 217     appendToBootstrapClassLoaderSearch(JarFile jarfile) {
 218         appendToClassLoaderSearch0(mNativeAgent, jarfile.getName(), true);
 219     }
 220 
 221     public void
 222     appendToSystemClassLoaderSearch(JarFile jarfile) {
 223         appendToClassLoaderSearch0(mNativeAgent, jarfile.getName(), false);
 224     }
 225 
 226     public boolean
 227     isNativeMethodPrefixSupported() {
 228         return mEnvironmentSupportsNativeMethodPrefix;
 229     }
 230 
 231     public synchronized void
 232     setNativeMethodPrefix(ClassFileTransformer transformer, String prefix) {
 233         if (!isNativeMethodPrefixSupported()) {




 193         redefineClasses0(mNativeAgent, definitions);
 194     }
 195 
 196     @SuppressWarnings("rawtypes")
 197     public Class[]
 198     getAllLoadedClasses() {
 199         return getAllLoadedClasses0(mNativeAgent);
 200     }
 201 
 202     @SuppressWarnings("rawtypes")
 203     public Class[]
 204     getInitiatedClasses(ClassLoader loader) {
 205         return getInitiatedClasses0(mNativeAgent, loader);
 206     }
 207 
 208     public long
 209     getObjectSize(Object objectToSize) {
 210         if (objectToSize == null) {
 211             throw new NullPointerException("null passed as 'objectToSize' in getObjectSize");
 212         }
 213         // Call the intrinsified method instead.
 214         return Runtime.sizeOf(objectToSize);
 215     }
 216 
 217     public void
 218     appendToBootstrapClassLoaderSearch(JarFile jarfile) {
 219         appendToClassLoaderSearch0(mNativeAgent, jarfile.getName(), true);
 220     }
 221 
 222     public void
 223     appendToSystemClassLoaderSearch(JarFile jarfile) {
 224         appendToClassLoaderSearch0(mNativeAgent, jarfile.getName(), false);
 225     }
 226 
 227     public boolean
 228     isNativeMethodPrefixSupported() {
 229         return mEnvironmentSupportsNativeMethodPrefix;
 230     }
 231 
 232     public synchronized void
 233     setNativeMethodPrefix(ClassFileTransformer transformer, String prefix) {
 234         if (!isNativeMethodPrefixSupported()) {


< prev index next >