# HG changeset patch # User Gilles Duboscq # Date 1367343542 -7200 # Node ID 3e884486cc8af0082293981bc1423deef7ce72c0 # Parent 45a73cd19baab68d467d877a73b197fe155cb01b Fix non-static args binding in JTT Do not run the version with arg binding when there is no args diff -r 45a73cd19baa -r 3e884486cc8a 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 Tue Apr 30 19:25:08 2013 +0200 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/JTTTest.java Tue Apr 30 19:39:02 2013 +0200 @@ -60,9 +60,9 @@ Object[] args = argsWithReceiver(receiver, argsToBind); JavaType[] parameterTypes = signatureToTypes(runtime.lookupJavaMethod(m)); assert parameterTypes.length == args.length; - for (int i = 0; i < argsToBind.length; i++) { + for (int i = 0; i < args.length; i++) { LocalNode local = graph.getLocal(i); - Constant c = Constant.forBoxed(parameterTypes[i].getKind(), argsToBind[i]); + Constant c = Constant.forBoxed(parameterTypes[i].getKind(), args[i]); ConstantNode replacement = ConstantNode.forConstant(c, runtime, graph); local.replaceAtUsages(replacement); } @@ -99,8 +99,10 @@ Result expect = executeExpected(method, receiver, args); test(method, expect, receiver, args); - this.argsToBind = args; - test(method, expect, receiver, args); - this.argsToBind = null; + if (args.length > 0) { + this.argsToBind = args; + test(method, expect, receiver, args); + this.argsToBind = null; + } } }