Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
LizBing committed May 4, 2024
1 parent 4d175e2 commit 80eeb44
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,20 @@ public HeapRegionSetBase humongousSet() {
return VMObjectFactory.newObject(HeapRegionSetBase.class, humongousSetAddr);
}

private Iterator<G1HeapRegion> heapRegionIterator() {
return hrm().heapRegionIterator();
private Iterator<G1HeapRegion> g1HeapRegionIterator() {
return hrm().g1HeapRegionIterator();
}

public void heapRegionIterate(HeapRegionClosure hrcl) {
Iterator<G1HeapRegion> iter = heapRegionIterator();
Iterator<G1HeapRegion> iter = g1HeapRegionIterator();
while (iter.hasNext()) {
G1HeapRegion hr = iter.next();
hrcl.doHeapRegion(hr);
}
}

public G1HeapRegion heapRegionForAddress(Address addr) {
Iterator<G1HeapRegion> iter = heapRegionIterator();
Iterator<G1HeapRegion> iter = g1HeapRegionIterator();
while (iter.hasNext()) {
G1HeapRegion hr = iter.next();
if (hr.isInRegion(addr)) {
Expand All @@ -139,7 +139,7 @@ public CollectedHeapName kind() {

@Override
public void liveRegionsIterate(LiveRegionsClosure closure) {
Iterator<G1HeapRegion> iter = heapRegionIterator();
Iterator<G1HeapRegion> iter = g1HeapRegionIterator();
while (iter.hasNext()) {
G1HeapRegion hr = iter.next();
closure.doLiveRegions(hr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public long shiftBy() {
return shiftByField.getValue(addr);
}

private class HeapRegionIterator implements Iterator<G1HeapRegion> {
private class G1HeapRegionIterator implements Iterator<G1HeapRegion> {
private long index;
private long length;
private G1HeapRegion next;
Expand Down Expand Up @@ -118,15 +118,15 @@ public G1HeapRegion positionToNext() {
@Override
public void remove() { /* not supported */ }

HeapRegionIterator(long totalLength) {
G1HeapRegionIterator(long totalLength) {
index = 0;
length = totalLength;
positionToNext();
}
}

public Iterator<G1HeapRegion> heapRegionIterator(long committedLength) {
return new HeapRegionIterator(committedLength);
public Iterator<G1HeapRegion> g1HeapRegionIterator(long committedLength) {
return new G1HeapRegionIterator(committedLength);
}

public G1HeapRegionTable(Address addr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public long length() {
return regions().length();
}

public Iterator<G1HeapRegion> heapRegionIterator() {
return regions().heapRegionIterator(length());
public Iterator<G1HeapRegion> g1HeapRegionIterator() {
return regions().g1HeapRegionIterator(length());
}

public HeapRegionManager(Address addr) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public Generation getGeneration() {
return gen; // SerialHeap generation
}

public G1HeapRegion getHeapRegion() {
public G1HeapRegion getG1HeapRegion() {
return hr; // G1 heap region
}

Expand Down Expand Up @@ -302,11 +302,11 @@ public void printOn(PrintStream tty, boolean printAddress, boolean verbose) {
getGeneration().printOn(tty); // does not include "\n"
}
tty.println();
} else if (getHeapRegion() != null) {
} else if (getG1HeapRegion() != null) {
// Address is in the G1 heap
if (verbose) {
tty.print("In G1 heap ");
getHeapRegion().printOn(tty); // includes "\n"
getG1HeapRegion().printOn(tty); // includes "\n"
} else {
tty.println("In G1 heap region");
}
Expand Down
2 changes: 1 addition & 1 deletion test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ private static void checkHeapRegion(String pid) throws Exception {
try {
agent.attach(Integer.parseInt(pid));
G1CollectedHeap heap = (G1CollectedHeap)VM.getVM().getUniverse().heap();
G1HeapRegion hr = heap.hrm().heapRegionIterator().next();
G1HeapRegion hr = heap.hrm().g1HeapRegionIterator().next();
G1HeapRegion hrTop = heap.hrm().getByAddress(hr.top());

Asserts.assertEquals(hr.top(), hrTop.top(),
Expand Down

0 comments on commit 80eeb44

Please sign in to comment.