Mercurial > hg > graal-jvmci-8
changeset 18347:4571c14bb4ef
fix short circuit for special classes and objects when retrieving object from a replay compilation context
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 12 Nov 2014 14:37:24 +0100 |
parents | ddd7829c45b1 |
children | 8253047fe0c0 |
files | graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java |
diffstat | 1 files changed, 12 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java Wed Nov 12 12:55:21 2014 +0100 +++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/remote/Context.java Wed Nov 12 14:37:24 2014 +0100 @@ -264,12 +264,7 @@ * In addition, copies in {@link #pool} are re-used. */ private Object copy(Object root) { - if (isAssignableTo(root.getClass(), DontCopyClasses)) { - return root; - } - if (SpecialStaticFields.containsKey(root)) { - return root; - } + assert !(isAssignableTo(root.getClass(), DontCopyClasses) || SpecialStaticFields.containsKey(root)); // System.out.printf("----- %s ------%n", s(obj)); assert pool.get(root) == null; Deque<Object> worklist = new IdentityLinkedList<>(); @@ -317,12 +312,17 @@ } return (T) proxy; } else { - Object value = pool.get(obj); - if (value == null) { - if (mode == Mode.Capturing) { - value = copy(obj); - } else { - throw new GraalInternalError("No captured state for %s", obj); + Object value; + if (isAssignableTo(obj.getClass(), DontCopyClasses) || SpecialStaticFields.containsKey(obj)) { + value = obj; + } else { + value = pool.get(obj); + if (value == null) { + if (mode == Mode.Capturing) { + value = copy(obj); + } else { + throw new GraalInternalError("No captured state for %s [class=%s]", obj, obj.getClass()); + } } } return (T) value;