agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java

agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java

Print this page
rev 7211 : [mq]: remove_ngen
rev 7213 : imported patch move_genspecs
rev 7214 : imported patch remove_n_gen

*** 32,44 **** import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.types.*; import sun.jvm.hotspot.utilities.*; public class GenCollectedHeap extends SharedHeap { ! private static CIntegerField nGensField; ! private static long gensOffset; ! private static AddressField genSpecsField; private static GenerationFactory genFactory; static { VM.registerVMInitializedObserver(new Observer() { --- 32,46 ---- import sun.jvm.hotspot.runtime.*; import sun.jvm.hotspot.types.*; import sun.jvm.hotspot.utilities.*; public class GenCollectedHeap extends SharedHeap { ! private static AddressField youngGenField; ! private static AddressField oldGenField; ! ! private static AddressField youngGenSpecField; ! private static AddressField oldGenSpecField; private static GenerationFactory genFactory; static { VM.registerVMInitializedObserver(new Observer() {
*** 49,87 **** } private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("GenCollectedHeap"); ! nGensField = type.getCIntegerField("_n_gens"); ! gensOffset = type.getField("_gens").getOffset(); ! genSpecsField = type.getAddressField("_gen_specs"); genFactory = new GenerationFactory(); } public GenCollectedHeap(Address addr) { super(addr); } public int nGens() { ! return (int) nGensField.getValue(addr); } public Generation getGen(int i) { if (Assert.ASSERTS_ENABLED) { Assert.that((i >= 0) && (i < nGens()), "Index " + i + " out of range (should be between 0 and " + nGens() + ")"); } ! if ((i < 0) || (i >= nGens())) { return null; } - - Address genAddr = addr.getAddressAt(gensOffset + - (i * VM.getVM().getAddressSize())); - return genFactory.newObject(addr.getAddressAt(gensOffset + - (i * VM.getVM().getAddressSize()))); } public boolean isIn(Address a) { for (int i = 0; i < nGens(); i++) { Generation gen = getGen(i); --- 51,93 ---- } private static synchronized void initialize(TypeDataBase db) { Type type = db.lookupType("GenCollectedHeap"); ! youngGenField = type.getAddressField("_young_gen"); ! oldGenField = type.getAddressField("_old_gen"); genFactory = new GenerationFactory(); + + Type colPolType = db.lookupType("GenCollectorPolicy"); + youngGenSpecField = colPolType.getAddressField("_young_gen_spec"); + oldGenSpecField = colPolType.getAddressField("_old_gen_spec"); } public GenCollectedHeap(Address addr) { super(addr); } public int nGens() { ! return 2; } public Generation getGen(int i) { if (Assert.ASSERTS_ENABLED) { Assert.that((i >= 0) && (i < nGens()), "Index " + i + " out of range (should be between 0 and " + nGens() + ")"); } ! switch (i) { ! case 0: ! return genFactory.newObject(youngGenField.getAddress()); ! case 1: ! return genFactory.newObject(oldGenField.getAddress()); ! default: ! // no generation for i, and assertions disabled. return null; } } public boolean isIn(Address a) { for (int i = 0; i < nGens(); i++) { Generation gen = getGen(i);
*** 118,134 **** if ((level < 0) || (level >= nGens())) { return null; } ! Address ptrList = genSpecsField.getValue(addr); ! if (ptrList == null) { ! return null; ! } return (GenerationSpec) VMObjectFactory.newObject(GenerationSpec.class, ! ptrList.getAddressAt(level * VM.getVM().getAddressSize())); } public CollectedHeapName kind() { return CollectedHeapName.GEN_COLLECTED_HEAP; } --- 124,142 ---- if ((level < 0) || (level >= nGens())) { return null; } ! if (level == 0) { ! return (GenerationSpec) ! VMObjectFactory.newObject(GenerationSpec.class, ! youngGenSpecField.getAddress()); ! } else { return (GenerationSpec) VMObjectFactory.newObject(GenerationSpec.class, ! oldGenSpecField.getAddress()); ! } } public CollectedHeapName kind() { return CollectedHeapName.GEN_COLLECTED_HEAP; }
agent/src/share/classes/sun/jvm/hotspot/memory/GenCollectedHeap.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File