comparison agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolKlass.java @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children d1605aabd0a1
comparison
equal deleted inserted replaced
110:a49a647afe9a 113:ba764ed4b6f2
30 import sun.jvm.hotspot.runtime.*; 30 import sun.jvm.hotspot.runtime.*;
31 import sun.jvm.hotspot.types.*; 31 import sun.jvm.hotspot.types.*;
32 32
33 // A ConstantPoolKlass is the klass of a ConstantPool 33 // A ConstantPoolKlass is the klass of a ConstantPool
34 34
35 public class ConstantPoolKlass extends ArrayKlass { 35 public class ConstantPoolKlass extends Klass {
36 static { 36 static {
37 VM.registerVMInitializedObserver(new Observer() { 37 VM.registerVMInitializedObserver(new Observer() {
38 public void update(Observable o, Object data) { 38 public void update(Observable o, Object data) {
39 initialize(VM.getVM().getTypeDataBase()); 39 initialize(VM.getVM().getTypeDataBase());
40 } 40 }
41 }); 41 });
42 } 42 }
43 43
44 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { 44 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
45 Type type = db.lookupType("constantPoolKlass"); 45 Type type = db.lookupType("constantPoolKlass");
46 headerSize = type.getSize() + Oop.getHeaderSize();
46 } 47 }
47 48
48 ConstantPoolKlass(OopHandle handle, ObjectHeap heap) { 49 ConstantPoolKlass(OopHandle handle, ObjectHeap heap) {
49 super(handle, heap); 50 super(handle, heap);
50 } 51 }
51 52
53 public long getObjectSize() { return alignObjectSize(headerSize); }
54
52 public void printValueOn(PrintStream tty) { 55 public void printValueOn(PrintStream tty) {
53 tty.print("ConstantPoolKlass"); 56 tty.print("ConstantPoolKlass");
54 } 57 }
55 }; 58
59 private static long headerSize;
60 }
61