# HG changeset patch # User shade # Date 1505823733 -7200 # Node ID 58136f79fff142f340dacbb4986ba8b18045b4f0 # Parent 43f78a0e79c826ef005c7deade39799ee6790d6d Avoid rendering plain live data for regular regions. diff -r 43f78a0e79c8 -r 58136f79fff1 src/main/java/org/openjdk/shenandoah/RegionStat.java --- a/src/main/java/org/openjdk/shenandoah/RegionStat.java Tue Sep 19 11:58:52 2017 +0200 +++ b/src/main/java/org/openjdk/shenandoah/RegionStat.java Tue Sep 19 14:22:13 2017 +0200 @@ -93,40 +93,43 @@ g.setColor(USED); g.fillRect(x, y, usedWidth, height); - int liveWidth = (int) (width * liveLvl); - g.setColor(selectLive(state)); - g.fillRect(x, y, liveWidth, height); - - g.setColor(LIVE_BORDER); - g.drawLine(x + liveWidth, y, x + liveWidth, y + height); + if (state == RegionState.REGULAR) { + if (gclabLvl > 0 || tlabLvl > 0 || sharedLvl > 0) { + int sharedWidth = (int) (width * liveLvl * sharedLvl); + int tlabWidth = (int) (width * liveLvl * tlabLvl); + int gclabWidth = (int) (width * liveLvl * gclabLvl); - if (state == RegionState.REGULAR && (gclabLvl > 0 || tlabLvl > 0 || sharedLvl > 0)) { - int sharedWidth = (int) (liveWidth * sharedLvl); - int tlabWidth = (int) (liveWidth * tlabLvl); - int gclabWidth = (int) (liveWidth * gclabLvl); + int h = height; + int ly = y + (height - h); + int lx = x; - int h = height; - int ly = y + (height - h); - int lx = x; + g.setColor(TLAB_ALLOC); + g.fillRect(lx, ly, tlabWidth, h); + g.setColor(TLAB_ALLOC_BORDER); + g.drawRect(lx, ly, tlabWidth, h); - g.setColor(TLAB_ALLOC); - g.fillRect(lx, ly, tlabWidth, h); - g.setColor(TLAB_ALLOC_BORDER); - g.drawRect(lx, ly, tlabWidth, h); + lx += tlabWidth; + g.setColor(GCLAB_ALLOC); + g.fillRect(lx, ly, gclabWidth, h); + g.setColor(GCLAB_ALLOC_BORDER); + g.drawRect(lx, ly, gclabWidth, h); - lx += tlabWidth; - g.setColor(GCLAB_ALLOC); - g.fillRect(lx, ly, gclabWidth, h); - g.setColor(GCLAB_ALLOC_BORDER); - g.drawRect(lx, ly, gclabWidth, h); + lx += gclabWidth; + g.setColor(SHARED_ALLOC); + g.fillRect(lx, ly, sharedWidth, h); + g.setColor(SHARED_ALLOC_BORDER); + g.drawRect(lx, ly, sharedWidth, h); + } + } else { + int liveWidth = (int) (width * liveLvl); + g.setColor(selectLive(state)); + g.fillRect(x, y, liveWidth, height); - lx += gclabWidth; - g.setColor(SHARED_ALLOC); - g.fillRect(lx, ly, sharedWidth, h); - g.setColor(SHARED_ALLOC_BORDER); - g.drawRect(lx, ly, sharedWidth, h); + g.setColor(LIVE_BORDER); + g.drawLine(x + liveWidth, y, x + liveWidth, y + height); } + if (state == RegionState.EMPTY_UNCOMMITTED || state == RegionState.TRASH) { g.setColor(Color.BLACK); g.drawLine(x, y, x + width, y + height);