8076012: SA don't support flags of type size_t
authorjwilhelm
Wed, 25 Mar 2015 19:50:00 +0100
changeset 29704 2a1a74472bfd
parent 29703 0bbea51cbaf8
child 29705 73f895aed804
child 29793 ddd5618b5804
8076012: SA don't support flags of type size_t Summary: Added support for flags of type size_t in VM.Flags Reviewed-by: sla, kbarrett
hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Mar 25 10:13:56 2015 +0100
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java	Wed Mar 25 19:50:00 2015 +0100
@@ -123,6 +123,7 @@
 
   private static Type intxType;
   private static Type uintxType;
+  private static Type sizetType;
   private static CIntegerType boolType;
   private Boolean sharingEnabled;
   private Boolean compressedOopsEnabled;
@@ -175,7 +176,7 @@
 
      public long getIntx() {
         if (Assert.ASSERTS_ENABLED) {
-           Assert.that(isIntx(), "not a intx flag!");
+           Assert.that(isIntx(), "not an intx flag!");
         }
         return addr.getCIntegerAt(0, intxType.getSize(), false);
      }
@@ -191,6 +192,17 @@
         return addr.getCIntegerAt(0, uintxType.getSize(), true);
      }
 
+     public boolean isSizet() {
+        return type.equals("size_t");
+     }
+
+     public long getSizet() {
+        if (Assert.ASSERTS_ENABLED) {
+           Assert.that(isSizet(), "not a size_t flag!");
+        }
+        return addr.getCIntegerAt(0, sizetType.getSize(), true);
+     }
+
      public String getValue() {
         if (isBool()) {
            return new Boolean(getBool()).toString();
@@ -198,6 +210,8 @@
            return new Long(getIntx()).toString();
         } else if (isUIntx()) {
            return new Long(getUIntx()).toString();
+        } else if (isSizet()) {
+            return new Long(getSizet()).toString();
         } else {
            return null;
         }
@@ -323,6 +337,7 @@
 
     intxType = db.lookupType("intx");
     uintxType = db.lookupType("uintx");
+    sizetType = db.lookupType("size_t");
     boolType = (CIntegerType) db.lookupType("bool");
 
     minObjAlignmentInBytes = getObjectAlignmentInBytes();