Mercurial > hg > truffle
diff graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/GraphTest.java @ 4993:897b7d18bebc
added RiCompiledMethod.execute and the required VM infrastructure
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Tue, 28 Feb 2012 18:00:35 +0100 |
parents | 646a6bfecf73 |
children |
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/GraphTest.java Tue Feb 28 17:53:07 2012 +0100 +++ b/graal/com.oracle.max.graal.tests/src/com/oracle/max/graal/compiler/tests/GraphTest.java Tue Feb 28 18:00:35 2012 +0100 @@ -76,6 +76,10 @@ * @param methodName the name of the method in {@code this.getClass()} to be parsed */ protected StructuredGraph parse(String methodName) { + return parse(getMethod(methodName)); + } + + protected Method getMethod(String methodName) { Method found = null; for (Method m : this.getClass().getMethods()) { if (m.getName().equals(methodName)) { @@ -84,7 +88,7 @@ } } if (found != null) { - return parse(found); + return found; } else { throw new RuntimeException("method not found: " + methodName); } @@ -96,18 +100,7 @@ * @param methodName the name of the method in {@code this.getClass()} to be parsed */ protected StructuredGraph parseProfiled(String methodName) { - Method found = null; - for (Method m : this.getClass().getMethods()) { - if (m.getName().equals(methodName)) { - Assert.assertNull(found); - found = m; - } - } - if (found != null) { - return parseProfiled(found); - } else { - throw new RuntimeException("method not found: " + methodName); - } + return parseProfiled(getMethod(methodName)); } /**