Skip to content

Commit

Permalink
Did some minor refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
gzachos committed Sep 30, 2019
1 parent ece49d2 commit 7fc984a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions mars/tools/StackVisualizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ public Component getTableCellRendererComponent(JTable table, Object value, boole
else if (row > spDataRowIndex) {
color = GRAY;
}
else {
if (row % 2 == 0)
else if (row % 2 == 0) {
color = LIGHT_GRAY;
}
c.setBackground(new Color(color));
Expand Down Expand Up @@ -514,23 +513,19 @@ private void processRegisterAccessNotice(RegisterAccessNotice notice) {
}

private void processStackMemoryUpdate(MemoryAccessNotice notice) {
String regName, frameName;
String regName = "", frameName = "";

if (notice.getAccessType() == AccessNotice.READ)
return;

if (regNameToBeStoredInStack != null) {
regName = regNameToBeStoredInStack;
regNameToBeStoredInStack = null;
} else {
regName = "";
}

if (frameNameToBeCreated != null) {
frameName = frameNameToBeCreated;
frameNameToBeCreated = null;
} else {
frameName = "";
}

if (debug) {
Expand Down Expand Up @@ -823,8 +818,9 @@ protected void reset() {
}

private void updateSpDataRowColIndex() {
spDataRowIndex = getTableRowIndex(getSpValue());
spDataColumnIndex = getTableColumnIndex(getSpValue());
int spValue = getSpValue();
spDataRowIndex = getTableRowIndex(spValue);
spDataColumnIndex = getTableColumnIndex(spValue);
}

private void resetStoredRegAndFrameNameColumns(int startRow, int endRow) {
Expand Down

0 comments on commit 7fc984a

Please sign in to comment.