Mercurial > hg > graal-compiler
changeset 14581:69dfb976fd26
clean state before merging iteration in PEA MergeProcessor
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Tue, 18 Mar 2014 10:04:29 +0100 |
parents | a15776cb4e6c |
children | 5fc6b8b54d82 |
files | graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopParseLong.java graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java |
diffstat | 2 files changed, 28 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopParseLong.java Tue Mar 18 10:01:08 2014 +0100 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/loop/LoopParseLong.java Tue Mar 18 10:04:29 2014 +0100 @@ -27,6 +27,25 @@ public class LoopParseLong extends JTTTest { + @SuppressWarnings("unused") + public static long testShortened(String s, int radix) throws NumberFormatException { + long result = 0; + boolean negative = false; + int len = s.length(); + char firstChar = s.charAt(0); + if (firstChar < '0') { + if (firstChar == '-') { + negative = true; + } else if (firstChar != '+') { + throw new NumberFormatException(); + } + if (len == 1) { + throw new NumberFormatException(); + } + } + return result; + } + public static long test(String s, int radix) throws NumberFormatException { if (s == null) { throw new NumberFormatException("null"); @@ -81,6 +100,8 @@ @LongTest public void run0() throws Throwable { + runTest("testShortened", "7", 10); + runTest("testShortened", "-100", 10); runTest("test", "7", 10); runTest("test", "-100", 10); }
--- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Tue Mar 18 10:01:08 2014 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Tue Mar 18 10:04:29 2014 +0100 @@ -335,6 +335,13 @@ ObjectState[] objStates = new ObjectState[states.size()]; boolean materialized; do { + Iterator<Map.Entry<VirtualObjectNode, ObjectState>> iter = newState.objectStates.entrySet().iterator(); + while (iter.hasNext()) { + Map.Entry<VirtualObjectNode, ObjectState> entry = iter.next(); + if (!virtualObjTemp.contains(entry.getValue())) { + iter.remove(); + } + } mergeEffects.clear(); afterMergeEffects.clear(); materialized = false;