< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/types/basic/BasicTypeDataBase.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2018, 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.

@@ -31,10 +31,11 @@
 import sun.jvm.hotspot.debugger.Address;
 import sun.jvm.hotspot.debugger.MachineDescription;
 import sun.jvm.hotspot.runtime.VM;
 import sun.jvm.hotspot.types.Type;
 import sun.jvm.hotspot.types.TypeDataBase;
+import sun.jvm.hotspot.memory.FileMapInfo;
 
 /** <P> This is a basic implementation of the TypeDataBase interface.
     It allows an external type database builder to add types to be
     consumed by a client through the Type interfaces. It has no
     knowledge of symbol lookup; for example, the builder is

@@ -292,10 +293,19 @@
     // required that the caller knows that the static type is at least
     // baseType.  See the notes in guessTypeForAddress for the logic of
     // the locations searched.
 
     Address loc1 = addr.getAddressAt(0);
+
+    if (VM.getVM().isSharingEnabled()) {
+      // Check if the value falls in the _md_region
+      FileMapInfo cdsFileMapInfo = VM.getVM().getFileMapInfo();
+      if (cdsFileMapInfo.inCopiedVtableSpace(loc1)) {
+         return cdsFileMapInfo.getTypeForVptrAddress(loc1);
+      }
+    }
+
     Address loc2 = null;
     Address loc3 = null;
     long offset2 = baseType.getSize();
     // I don't think this should be misaligned under any
     // circumstances, but I'm not sure (FIXME: also not sure which
< prev index next >