# HG changeset patch # User Gilles Duboscq # Date 1389964056 -3600 # Node ID c700811a2814b67923839d3c162605b464717ae1 # Parent bd94d77af2c1fd0f8d89034f75a904e18f58bc4c JTTTest: add optional 'bind' and 'noProfile' parameters diff -r bd94d77af2c1 -r c700811a2814 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java --- 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 EMPTY = Collections. 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. emptySet(), name, args); + runTest(EMPTY, name, args); } protected void runTest(Set shouldNotDeopt, String name, Object... args) { + runTest(shouldNotDeopt, true, false, name, args); + } + + protected void runTest(Set 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;