--- old/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheKlass.java 2009-08-01 04:06:27.948851720 +0100 +++ new/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheKlass.java 2009-08-01 04:06:27.875313005 +0100 @@ -1,5 +1,5 @@ /* - * 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 @@ -32,7 +32,7 @@ // 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) { @@ -43,13 +43,20 @@ 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; } + +