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 */ 23 package jdk.vm.ci.meta; 24 25 import java.io.*; 26 import java.lang.reflect.*; 27 import java.util.*; 28 29 /** 30 * Miscellaneous collection of utility methods used by {@code jdk.vm.ci.meta} and its clients. 31 */ 32 public class MetaUtil { 33 34 private static class ClassInfo { 35 public long totalSize; 36 public long instanceCount; 37 38 @Override 39 public String toString() { 40 return "totalSize=" + totalSize + ", instanceCount=" + instanceCount; 41 } 42 } 43 44 /** 45 * Returns the number of bytes occupied by this constant value or constant object and 46 * recursively all values reachable from this value. 47 * | 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 */ 23 package jdk.vm.ci.meta; 24 25 import java.io.PrintStream; 26 import java.lang.reflect.Field; 27 import java.lang.reflect.Modifier; 28 import java.util.ArrayDeque; 29 import java.util.ArrayList; 30 import java.util.Collections; 31 import java.util.Comparator; 32 import java.util.Deque; 33 import java.util.HashMap; 34 import java.util.HashSet; 35 import java.util.Set; 36 37 /** 38 * Miscellaneous collection of utility methods used by {@code jdk.vm.ci.meta} and its clients. 39 */ 40 public class MetaUtil { 41 42 private static class ClassInfo { 43 public long totalSize; 44 public long instanceCount; 45 46 @Override 47 public String toString() { 48 return "totalSize=" + totalSize + ", instanceCount=" + instanceCount; 49 } 50 } 51 52 /** 53 * Returns the number of bytes occupied by this constant value or constant object and 54 * recursively all values reachable from this value. 55 * |