Lines Matching refs:Instance
22 import com.android.tools.perflib.heap.Instance;
32 * Returns true if the given instance is an instance of a class with the
35 private static boolean isInstanceOfClass(Instance inst, String className) {
41 * Read the byte[] value from an hprof Instance.
42 * Returns null if the instance is not a byte array.
44 private static byte[] asByteArray(Instance inst) {
65 * Read the string value from an hprof Instance.
68 public static String asString(Instance inst) {
73 * Read the string value from an hprof Instance.
78 public static String asString(Instance inst, int maxChars) {
121 public static BufferedImage asBitmap(Instance inst) {
159 * Read a field of an instance.
162 public static Object getField(Instance inst, String fieldName) {
180 * Read a reference field of an instance.
183 private static Instance getRefField(Instance inst, String fieldName) {
185 if (!(value instanceof Instance)) {
188 return (Instance)value;
192 * Read an int field of an instance.
197 private static Integer getIntField(Instance inst, String fieldName, Integer def) {
206 * Read a long field of an instance.
211 private static Long getLongField(Instance inst, String fieldName, Long def) {
220 * Read the given field from the given instance.
224 private static byte[] getByteArrayField(Instance inst, String fieldName) {
226 if (!(value instanceof Instance)) {
229 return asByteArray((Instance)value);
232 // Return the bitmap instance associated with this object, or null if there
235 public static Instance getAssociatedBitmapInstance(Instance inst) {
248 Instance ref = inst.getHardReferences().get(0);
258 private static boolean isJavaLangRefReference(Instance inst) {
269 public static Instance getReferent(Instance inst) {
278 * that dex cache. Returns null if the given instance doesn't represent a
283 public static String getDexCacheLocation(Instance inst, int maxChars) {
285 Instance location = getRefField(inst, "location");
297 public Instance referent;
299 public NativeAllocation(long size, Heap heap, long pointer, Instance referent) {
309 * native allocation. Returns null if the given instance doesn't represent a
312 public static NativeAllocation getNativeAllocation(Instance inst) {
323 // Note: We know inst as an instance of ClassInstance because we already
325 Instance registry = null;
328 if (fieldValue instanceof Instance) {
329 Instance fieldInst = (Instance)fieldValue;
346 Instance referent = null;
347 for (Instance ref : inst.getHardReferences()) {