< prev index next >

test/lib/jdk/test/whitebox/WhiteBox.java

Print this page

  1 /*
  2  * Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */

102   // Make sure class name is in the correct format
103   public int countAliveClasses(String name) {
104     return countAliveClasses0(name.replace('.', '/'));
105   }
106   private native int countAliveClasses0(String name);
107 
108   public boolean isClassAlive(String name) {
109     return countAliveClasses(name) != 0;
110   }
111 
112   public  native int getSymbolRefcount(String name);
113 
114   public native boolean deflateIdleMonitors();
115 
116   private native boolean isMonitorInflated0(Object obj);
117   public         boolean isMonitorInflated(Object obj) {
118     Objects.requireNonNull(obj);
119     return isMonitorInflated0(obj);
120   }
121 




122   public native void forceSafepoint();
123 
124   private native long getConstantPool0(Class<?> aClass);
125   public         long getConstantPool(Class<?> aClass) {
126     Objects.requireNonNull(aClass);
127     return getConstantPool0(aClass);
128   }
129 
130   private native int getConstantPoolCacheIndexTag0();
131   public         int getConstantPoolCacheIndexTag() {
132     return getConstantPoolCacheIndexTag0();
133   }
134 
135   private native int getConstantPoolCacheLength0(Class<?> aClass);
136   public         int getConstantPoolCacheLength(Class<?> aClass) {
137     Objects.requireNonNull(aClass);
138     return getConstantPoolCacheLength0(aClass);
139   }
140 
141   private native int remapInstructionOperandFromCPCache0(Class<?> aClass, int index);

  1 /*
  2  * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
  3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  4  *
  5  * This code is free software; you can redistribute it and/or modify it
  6  * under the terms of the GNU General Public License version 2 only, as
  7  * published by the Free Software Foundation.
  8  *
  9  * This code is distributed in the hope that it will be useful, but WITHOUT
 10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 12  * version 2 for more details (a copy is included in the LICENSE file that
 13  * accompanied this code).
 14  *
 15  * You should have received a copy of the GNU General Public License version
 16  * 2 along with this work; if not, write to the Free Software Foundation,
 17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 18  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  */

102   // Make sure class name is in the correct format
103   public int countAliveClasses(String name) {
104     return countAliveClasses0(name.replace('.', '/'));
105   }
106   private native int countAliveClasses0(String name);
107 
108   public boolean isClassAlive(String name) {
109     return countAliveClasses(name) != 0;
110   }
111 
112   public  native int getSymbolRefcount(String name);
113 
114   public native boolean deflateIdleMonitors();
115 
116   private native boolean isMonitorInflated0(Object obj);
117   public         boolean isMonitorInflated(Object obj) {
118     Objects.requireNonNull(obj);
119     return isMonitorInflated0(obj);
120   }
121 
122   public native int getLockStackCapacity();
123 
124   public native boolean supportsRecursiveLightweightLocking();
125 
126   public native void forceSafepoint();
127 
128   private native long getConstantPool0(Class<?> aClass);
129   public         long getConstantPool(Class<?> aClass) {
130     Objects.requireNonNull(aClass);
131     return getConstantPool0(aClass);
132   }
133 
134   private native int getConstantPoolCacheIndexTag0();
135   public         int getConstantPoolCacheIndexTag() {
136     return getConstantPoolCacheIndexTag0();
137   }
138 
139   private native int getConstantPoolCacheLength0(Class<?> aClass);
140   public         int getConstantPoolCacheLength(Class<?> aClass) {
141     Objects.requireNonNull(aClass);
142     return getConstantPoolCacheLength0(aClass);
143   }
144 
145   private native int remapInstructionOperandFromCPCache0(Class<?> aClass, int index);
< prev index next >