74 return usedRegions.getValue(addr);
75 }
76
77 public long committed() {
78 return committedRegions.getValue(addr);
79 }
80
81 public void heapRegionIterate(sun.jvm.hotspot.gc.shared.SpaceClosure scl) {
82 int numRgns = (int)numRegions.getValue(addr);
83 for (int index = 0; index < numRgns; index ++) {
84 ShenandoahHeapRegion r = getRegion(index);
85
86 // Walk live regions
87 if (!r.isTrash() && !r.isUncommitted() && !r.isEmpty()) {
88 scl.doSpace(r);
89 }
90 }
91 }
92
93 @Override
94 public int cell_header_size() {
95 return VM.getVM().getHeapWordSize();
96 }
97
98 @Override
99 public void printOn(PrintStream tty) {
100 MemRegion mr = reservedRegion();
101 tty.print("Shenandoah heap");
102 tty.print(" [" + mr.start() + ", " + mr.end() + "]");
103 tty.println(" region size " + ShenandoahHeapRegion.regionSizeBytes() / 1024 + " K");
104 }
105
106 private ShenandoahHeapRegion getRegion(int index) {
107 Address regsAddr = regionsField.getValue(addr);
108 return (ShenandoahHeapRegion) VMObjectFactory.newObject(ShenandoahHeapRegion.class,
109 regsAddr.getAddressAt(index * VM.getVM().getAddressSize()));
110 }
111
112 public ShenandoahHeap(Address addr) {
113 super(addr);
114 }
115 }
|
74 return usedRegions.getValue(addr);
75 }
76
77 public long committed() {
78 return committedRegions.getValue(addr);
79 }
80
81 public void heapRegionIterate(sun.jvm.hotspot.gc.shared.SpaceClosure scl) {
82 int numRgns = (int)numRegions.getValue(addr);
83 for (int index = 0; index < numRgns; index ++) {
84 ShenandoahHeapRegion r = getRegion(index);
85
86 // Walk live regions
87 if (!r.isTrash() && !r.isUncommitted() && !r.isEmpty()) {
88 scl.doSpace(r);
89 }
90 }
91 }
92
93 @Override
94 public void printOn(PrintStream tty) {
95 MemRegion mr = reservedRegion();
96 tty.print("Shenandoah heap");
97 tty.print(" [" + mr.start() + ", " + mr.end() + "]");
98 tty.println(" region size " + ShenandoahHeapRegion.regionSizeBytes() / 1024 + " K");
99 }
100
101 private ShenandoahHeapRegion getRegion(int index) {
102 Address regsAddr = regionsField.getValue(addr);
103 return (ShenandoahHeapRegion) VMObjectFactory.newObject(ShenandoahHeapRegion.class,
104 regsAddr.getAddressAt(index * VM.getVM().getAddressSize()));
105 }
106
107 public ShenandoahHeap(Address addr) {
108 super(addr);
109 }
110 }
|