changeset 33:58136f79fff1

Avoid rendering plain live data for regular regions.
author shade
date Tue, 19 Sep 2017 14:22:13 +0200
parents 43f78a0e79c8
children 1811e9a03fa8
files src/main/java/org/openjdk/shenandoah/RegionStat.java
diffstat 1 files changed, 30 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- 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);