Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/oops/Instance.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 |
---|---|
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 private static long typeSize; | |
43 | 44 |
44 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { | 45 private static synchronized void initialize(TypeDataBase db) throws WrongTypeException { |
45 Type type = db.lookupType("instanceOopDesc"); | 46 Type type = db.lookupType("instanceOopDesc"); |
47 typeSize = type.getSize(); | |
46 } | 48 } |
47 | 49 |
48 Instance(OopHandle handle, ObjectHeap heap) { | 50 Instance(OopHandle handle, ObjectHeap heap) { |
49 super(handle, heap); | 51 super(handle, heap); |
52 } | |
53 | |
54 // Returns header size in bytes. | |
55 public static long getHeaderSize() { | |
56 if (VM.getVM().isCompressedOopsEnabled()) { | |
57 return typeSize - VM.getVM().getIntSize(); | |
58 } else { | |
59 return typeSize; | |
60 } | |
50 } | 61 } |
51 | 62 |
52 public boolean isInstance() { return true; } | 63 public boolean isInstance() { return true; } |
53 | 64 |
54 public void iterateFields(OopVisitor visitor, boolean doVMFields) { | 65 public void iterateFields(OopVisitor visitor, boolean doVMFields) { |