# HG changeset patch # User Christian Humer # Date 1378479272 -7200 # Node ID 6014bd8d52ce82a797c230a43aceccebe8b4098c # Parent cefd4cb3cb2de4600442101b229ccf843939f005# Parent 601755e6848b77abdd27aa195a89e4f62b949b38 Merge. diff -r cefd4cb3cb2d -r 6014bd8d52ce graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java --- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Fri Sep 06 16:17:16 2013 +0200 +++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java Fri Sep 06 16:54:32 2013 +0200 @@ -125,37 +125,49 @@ } } + int extractOriginalNodeId(Node node) { + int id = node.id; + if (id <= Node.DELETED_ID_START) { + id = Node.DELETED_ID_START - id; + } + return id; + } + int modCount(Node node) { - if (node.id >= 0 && node.id < nodeModCounts.length) { - return nodeModCounts[node.id]; + int id = extractOriginalNodeId(node); + if (id >= 0 && id < nodeModCounts.length) { + return nodeModCounts[id]; } return 0; } void incModCount(Node node) { - if (node.id >= 0) { - if (node.id >= nodeModCounts.length) { - nodeModCounts = Arrays.copyOf(nodeModCounts, node.id + 30); + int id = extractOriginalNodeId(node); + if (id >= 0) { + if (id >= nodeModCounts.length) { + nodeModCounts = Arrays.copyOf(nodeModCounts, id + 30); } - nodeModCounts[node.id]++; + nodeModCounts[id]++; } else { assert false; } } int usageModCount(Node node) { - if (node.id >= 0 && node.id < nodeUsageModCounts.length) { + int id = extractOriginalNodeId(node); + if (id >= 0 && id < nodeUsageModCounts.length) { return nodeUsageModCounts[node.id]; } return 0; } void incUsageModCount(Node node) { - if (node.id >= 0) { - if (node.id >= nodeUsageModCounts.length) { - nodeUsageModCounts = Arrays.copyOf(nodeUsageModCounts, node.id + 30); + int id = extractOriginalNodeId(node); + if (id >= 0) { + if (id >= nodeUsageModCounts.length) { + nodeUsageModCounts = Arrays.copyOf(nodeUsageModCounts, id + 30); } - nodeUsageModCounts[node.id]++; + nodeUsageModCounts[id]++; } else { assert false; }