< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java

Print this page

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

@@ -82,12 +82,10 @@
     tags        = type.getAddressField("_tags");
     operands    = type.getAddressField("_operands");
     cache       = type.getAddressField("_cache");
     poolHolder  = new MetadataField(type.getAddressField("_pool_holder"), 0);
     length      = new CIntField(type.getCIntegerField("_length"), 0);
-    resolvedReferences      = type.getAddressField("_resolved_references");
-    referenceMap = type.getAddressField("_reference_map");
     headerSize  = type.getSize();
     elementSize = 0;
     // fetch constants:
     INDY_BSM_OFFSET = db.lookupIntConstant("ConstantPool::_indy_bsm_offset").intValue();
     INDY_ARGC_OFFSET = db.lookupIntConstant("ConstantPool::_indy_argc_offset").intValue();

@@ -103,12 +101,10 @@
   private static AddressField tags;
   private static AddressField operands;
   private static AddressField cache;
   private static MetadataField poolHolder;
   private static CIntField length; // number of elements in oop
-  private static AddressField  resolvedReferences;
-  private static AddressField  referenceMap;
 
   private static long headerSize;
   private static long elementSize;
 
   private static int INDY_BSM_OFFSET;

@@ -122,21 +118,15 @@
     return (ConstantPoolCache) VMObjectFactory.newObject(ConstantPoolCache.class, addr);
   }
   public InstanceKlass     getPoolHolder() { return (InstanceKlass)poolHolder.getValue(this); }
   public int               getLength()     { return (int)length.getValue(getAddress()); }
   public Oop               getResolvedReferences() {
-    Address handle = resolvedReferences.getValue(getAddress());
-    if (handle != null) {
-      // Load through the handle
-      OopHandle refs = handle.getOopHandleAt(0);
-      return VM.getVM().getObjectHeap().newOop(refs);
-    }
-    return null;
+    return getCache().getResolvedReferences();
   }
 
   public U2Array referenceMap() {
-    return new U2Array(referenceMap.getValue(getAddress()));
+    return getCache().referenceMap();
   }
 
   public int objectToCPIndex(int index) {
     return referenceMap().at(index);
   }
< prev index next >