hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolKlass.java
Print this page
rev 611 : Merge
*** 1,7 ****
/*
! * Copyright 2000-2001 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.
--- 1,7 ----
/*
! * 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,55 ****
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
// A ConstantPoolKlass is the klass of a ConstantPool
! public class ConstantPoolKlass extends ArrayKlass {
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("constantPoolKlass");
}
ConstantPoolKlass(OopHandle handle, ObjectHeap heap) {
super(handle, heap);
}
public void printValueOn(PrintStream tty) {
tty.print("ConstantPoolKlass");
}
! };
--- 30,61 ----
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
// A ConstantPoolKlass is the klass of a ConstantPool
! public class ConstantPoolKlass 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("constantPoolKlass");
+ headerSize = type.getSize() + Oop.getHeaderSize();
}
ConstantPoolKlass(OopHandle handle, ObjectHeap heap) {
super(handle, heap);
}
+ public long getObjectSize() { return alignObjectSize(headerSize); }
+
public void printValueOn(PrintStream tty) {
tty.print("ConstantPoolKlass");
}
!
! private static long headerSize;
! }
!