< prev index next >

test/lib/jdk/test/lib/hprof/model/Snapshot.java

Print this page
*** 1,7 ***
  /*
!  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this
--- 1,7 ---
  /*
!  * Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   *
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2 only, as
   * published by the Free Software Foundation.  Oracle designates this

*** 69,10 ***
--- 69,14 ---
  
      // name-to-class map
      private Map<String, JavaClass> classes =
                   new TreeMap<String, JavaClass>();
  
+     private Map<Number, Number> flatArrays = new HashMap<>();
+ 
+     private Map<Number, ClassInlinedFields[]> inlinedFields = new HashMap<>();
+ 
      // new objects relative to a baseline - lazily initialized
      private volatile Map<JavaHeapObject, Boolean> newObjects;
  
      // allocation site traces for all objects - lazily initialized
      private volatile Map<JavaHeapObject, StackTrace> siteTraces;

*** 202,10 ***
--- 206,45 ---
          // Add the class
          addFakeClass(makeId(classID), c);
          return c;
      }
  
+     public void addFlatArray(long objID, long elementClassID) {
+         flatArrays.put(makeId(objID), makeId(elementClassID));
+     }
+ 
+     /**
+      * @return null if the array is not flat array
+      */
+     Number findFlatArrayElementType(long arrayObjectID) {
+         return flatArrays.get(makeId(arrayObjectID));
+     }
+ 
+     public static class ClassInlinedFields {
+         final int fieldIndex;
+         final int synthFieldCount;
+         final String fieldName;
+         final long fieldClassID;
+ 
+         public ClassInlinedFields(int fieldIndex, int synthFieldCount, String fieldName, long fieldClassID) {
+             this.fieldIndex = fieldIndex;
+             this.synthFieldCount = synthFieldCount;
+             this.fieldName = fieldName;
+             this.fieldClassID =  fieldClassID;
+         }
+     }
+ 
+     public void addClassInlinedFields(long classID, ClassInlinedFields[] fields) {
+         inlinedFields.put(makeId(classID), fields);
+     }
+ 
+     /**
+      * @return null if the class has no inlined fields
+      */
+     ClassInlinedFields[] findClassInlinedFields(long classID) {
+         return inlinedFields.get(makeId(classID));
+     }
  
      /**
       * @return true iff it's possible that some JavaThing instances might
       *          isNew set
       *
< prev index next >