Mercurial > hg > truffle
changeset 13674:c700811a2814
JTTTest: add optional 'bind' and 'noProfile' parameters
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Fri, 17 Jan 2014 14:07:36 +0100 |
parents | bd94d77af2c1 |
children | a87e5c330cbd |
files | graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Fri Jan 17 14:07:06 2014 +0100 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Fri Jan 17 14:07:36 2014 +0100 @@ -44,6 +44,7 @@ */ public class JTTTest extends GraalCompilerTest { + protected static final Set<DeoptimizationReason> EMPTY = Collections.<DeoptimizationReason> emptySet(); /** * The arguments which, if non-null, will replace the Locals in the test method's graph. */ @@ -94,17 +95,29 @@ } protected void runTest(String name, Object... args) { - runTest(Collections.<DeoptimizationReason> emptySet(), name, args); + runTest(EMPTY, name, args); } protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, String name, Object... args) { + runTest(shouldNotDeopt, true, false, name, args); + } + + protected void runTest(Set<DeoptimizationReason> shouldNotDeopt, boolean bind, boolean noProfile, String name, Object... args) { Method method = getMethod(name); Object receiver = Modifier.isStatic(method.getModifiers()) ? null : this; Result expect = executeExpected(method, receiver, args); + if (noProfile) { + getMetaAccess().lookupJavaMethod(method).reprofile(); + } + testAgainstExpected(method, expect, shouldNotDeopt, receiver, args); - if (args.length > 0) { + if (args.length > 0 && bind) { + if (noProfile) { + getMetaAccess().lookupJavaMethod(method).reprofile(); + } + this.argsToBind = args; testAgainstExpected(method, expect, shouldNotDeopt, receiver, args); this.argsToBind = null;