changeset 18879:ec7dcd210467

made Graph.cachedLeafNodes stable across VM executions to support replay compilation
author Doug Simon <doug.simon@oracle.com>
date Mon, 19 Jan 2015 14:46:55 +0100
parents d0f34a3055cf
children 5be321eab6ac
files graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java	Mon Jan 19 14:46:21 2015 +0100
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java	Mon Jan 19 14:46:55 2015 +0100
@@ -750,6 +750,12 @@
     @SuppressWarnings("unused")
     private void postDeserialization() {
         recomputeIterableNodeLists();
+
+        // CacheEntry.hashCode() is not stable across VM executions so
+        // the cachedLeafNodes map needs to be re-created.
+        HashMap<CacheEntry, Node> entries = new LinkedHashMap<>(cachedLeafNodes);
+        cachedLeafNodes.clear();
+        cachedLeafNodes.putAll(entries);
     }
 
     /**