Mercurial > hg > truffle
changeset 11548:6014bd8d52ce
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 06 Sep 2013 16:54:32 +0200 |
parents | cefd4cb3cb2d (current diff) 601755e6848b (diff) |
children | 794127021076 2391d44f9d2c |
files | |
diffstat | 1 files changed, 23 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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; }