hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheKlass.java

Print this page
rev 611 : Merge

@@ -1,7 +1,7 @@
 /*
- * Copyright 2000-2001 Sun Microsystems, Inc.  All Rights Reserved.
+ * Copyright 2000-2008 Sun Microsystems, Inc.  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.

@@ -30,26 +30,33 @@
 import sun.jvm.hotspot.runtime.*;
 import sun.jvm.hotspot.types.*;
 
 // A ConstantPoolCacheKlass is the klass of a ConstantPoolCache
 
-public class ConstantPoolCacheKlass extends ArrayKlass {
+public class ConstantPoolCacheKlass extends Klass {
   static {
     VM.registerVMInitializedObserver(new Observer() {
         public void update(Observable o, Object data) {
           initialize(VM.getVM().getTypeDataBase());
         }
       });
   }
   
   private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
     Type type  = db.lookupType("constantPoolCacheKlass");
+    headerSize = type.getSize() + Oop.getHeaderSize();
   }
 
   ConstantPoolCacheKlass(OopHandle handle, ObjectHeap heap) {
     super(handle, heap);
   }
 
+  public long getObjectSize() { return alignObjectSize(headerSize); }
+
   public void printValueOn(PrintStream tty) {
     tty.print("ConstantPoolCacheKlass");
   }
+
+  private static long headerSize;
 }
+
+