# HG changeset patch # User Doug Simon # Date 1417378326 -3600 # Node ID 77b55091cca17826905275c23d75e84ef9c6c15a # Parent f262c6c5fb7a8cb1477f082f9781cbd6617eb90a removed object pool sharing across unique Contexts diff -r f262c6c5fb7a -r 77b55091cca1 graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java --- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java Sun Nov 30 21:09:07 2014 +0100 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java Sun Nov 30 21:12:06 2014 +0100 @@ -41,7 +41,6 @@ public class Context implements AutoCloseable { private static final ThreadLocal currentContext = new ThreadLocal<>(); - private static final ThreadLocal previousContext = new ThreadLocal<>(); private final Map, Fields> fieldsMap = new HashMap<>(); @@ -329,9 +328,6 @@ return srcValue; } dstValue = pool.get(srcValue); - if (dstValue == null && previousPool != null) { - dstValue = previousPool.get(srcValue); - } if (dstValue == null) { if (srcValue instanceof Remote) { dstValue = get(srcValue); @@ -392,19 +388,11 @@ public Context() { assert currentContext.get() == null : currentContext.get(); currentContext.set(this); - Context previous = previousContext.get(); - if (previous != null) { - previousPool = previous.pool; - pool = new IdentityHashMap<>(previousPool.size()); - } else { - pool = new IdentityHashMap<>(); - previousPool = null; - } + pool = new IdentityHashMap<>(); } private final Map proxies = new IdentityHashMap<>(); private final Map pool; - private final Map previousPool; int invocationCacheHits; int invocationCacheMisses; @@ -448,22 +436,9 @@ public void close() { assert currentContext.get() == this : currentContext.get(); if (DEBUG) { - int overlap = 0; - if (previousPool != null) { - for (Object key : previousPool.keySet()) { - if (pool.containsKey(key)) { - overlap++; - } - } - } - if (DEBUG) { - System.out.printf("proxies: %d, pool: %d, overlap: %d, invocation cache hits: %d, invocation cache misses: %d%n", proxies.size(), pool.size(), overlap, invocationCacheHits, - invocationCacheMisses); - } + System.out.printf("proxies: %d, pool: %d, invocation cache hits: %d, invocation cache misses: %d%n", proxies.size(), pool.size(), invocationCacheHits, invocationCacheMisses); } currentContext.set(null); - previousContext.set(this); - } /**