src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java
changeset 47619 74f5b6c267e3
parent 47602 d4380ee1cbe9
child 49463 ccb003941743
--- a/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java	Wed Oct 11 10:03:22 2017 -0400
+++ b/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/gc/g1/HeapRegion.java	Wed Oct 11 23:29:24 2017 +0900
@@ -38,7 +38,6 @@
 import sun.jvm.hotspot.types.CIntegerField;
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
-import sun.jvm.hotspot.utilities.Assert;
 
 // Mirror class for HeapRegion. Currently we don't actually include
 // any of its fields but only iterate over it.
@@ -76,12 +75,8 @@
 
     public HeapRegion(Address addr) {
         super(addr);
-
-        if (Assert.ASSERTS_ENABLED) {
-            Assert.that(addr instanceof OopHandle, "addr should be OopHandle");
-        }
-
-        Address typeAddr = addr.addOffsetToAsOopHandle(typeFieldOffset);
+        Address typeAddr = (addr instanceof OopHandle) ? addr.addOffsetToAsOopHandle(typeFieldOffset)
+                                                       : addr.addOffsetTo(typeFieldOffset);
         type = (HeapRegionType)VMObjectFactory.newObject(HeapRegionType.class, typeAddr);
     }