< prev index next >

agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java

Print this page




 212      public long getUIntx() {
 213         if (Assert.ASSERTS_ENABLED) {
 214            Assert.that(isUIntx(), "not a uintx flag!");
 215         }
 216         return addr.getCIntegerAt(0, uintxType.getSize(), true);
 217      }
 218 
 219      public boolean isSizet() {
 220         return type.equals("size_t");
 221      }
 222 
 223      public long getSizet() {
 224         if (Assert.ASSERTS_ENABLED) {
 225            Assert.that(isSizet(), "not a size_t flag!");
 226         }
 227         return addr.getCIntegerAt(0, sizetType.getSize(), true);
 228      }
 229 
 230      public String getValue() {
 231         if (isBool()) {
 232            return new Boolean(getBool()).toString();
 233         } else if (isInt()) {
 234            return new Long(getInt()).toString();
 235         } else if (isUInt()) {
 236            return new Long(getUInt()).toString();
 237         } else if (isIntx()) {
 238            return new Long(getIntx()).toString();
 239         } else if (isUIntx()) {
 240            return new Long(getUIntx()).toString();
 241         } else if (isSizet()) {
 242             return new Long(getSizet()).toString();
 243         } else {
 244            return null;
 245         }
 246      }
 247   };
 248 
 249   private static void checkVMVersion(String vmRelease) {
 250      if (System.getProperty("sun.jvm.hotspot.runtime.VM.disableVersionCheck") == null) {
 251         // read sa build version.
 252         String versionProp = "sun.jvm.hotspot.runtime.VM.saBuildVersion";
 253         String saVersion = saProps.getProperty(versionProp);
 254         if (saVersion == null)
 255            throw new RuntimeException("Missing property " + versionProp);
 256 
 257         // Strip nonproduct VM version substring (note: saVersion doesn't have it).
 258         String vmVersion = vmRelease.replaceAll("(-fastdebug)|(-debug)|(-jvmg)|(-optimized)|(-profiled)","");
 259 
 260         if (saVersion.equals(vmVersion)) {
 261            // Exact match
 262            return;




 212      public long getUIntx() {
 213         if (Assert.ASSERTS_ENABLED) {
 214            Assert.that(isUIntx(), "not a uintx flag!");
 215         }
 216         return addr.getCIntegerAt(0, uintxType.getSize(), true);
 217      }
 218 
 219      public boolean isSizet() {
 220         return type.equals("size_t");
 221      }
 222 
 223      public long getSizet() {
 224         if (Assert.ASSERTS_ENABLED) {
 225            Assert.that(isSizet(), "not a size_t flag!");
 226         }
 227         return addr.getCIntegerAt(0, sizetType.getSize(), true);
 228      }
 229 
 230      public String getValue() {
 231         if (isBool()) {
 232            return Boolean.toString(getBool());
 233         } else if (isInt()) {
 234            return Long.toString(getInt());
 235         } else if (isUInt()) {
 236            return Long.toString(getUInt());
 237         } else if (isIntx()) {
 238            return Long.toString(getIntx());
 239         } else if (isUIntx()) {
 240            return Long.toString(getUIntx());
 241         } else if (isSizet()) {
 242             return Long.toString(getSizet());
 243         } else {
 244            return null;
 245         }
 246      }
 247   };
 248 
 249   private static void checkVMVersion(String vmRelease) {
 250      if (System.getProperty("sun.jvm.hotspot.runtime.VM.disableVersionCheck") == null) {
 251         // read sa build version.
 252         String versionProp = "sun.jvm.hotspot.runtime.VM.saBuildVersion";
 253         String saVersion = saProps.getProperty(versionProp);
 254         if (saVersion == null)
 255            throw new RuntimeException("Missing property " + versionProp);
 256 
 257         // Strip nonproduct VM version substring (note: saVersion doesn't have it).
 258         String vmVersion = vmRelease.replaceAll("(-fastdebug)|(-debug)|(-jvmg)|(-optimized)|(-profiled)","");
 259 
 260         if (saVersion.equals(vmVersion)) {
 261            // Exact match
 262            return;


< prev index next >