Mercurial > hg > graal-compiler
diff graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/GuardsTest.java @ 9345:0a8bf24d660a
Implemented improvements to the generated source code.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 26 Apr 2013 22:43:23 +0200 |
parents | 8e3a1635cc9e |
children | 86d981cd8e22 |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/GuardsTest.java Thu Apr 25 19:44:58 2013 +0200 +++ b/graal/com.oracle.truffle.api.codegen.test/src/com/oracle/truffle/api/codegen/test/GuardsTest.java Fri Apr 26 22:43:23 2013 +0200 @@ -45,19 +45,23 @@ assertEquals(Integer.MAX_VALUE, executeWith(root, Integer.MAX_VALUE - 1, 1)); assertEquals(1, InvocationGuard.specializedInvocations); assertEquals(0, InvocationGuard.genericInvocations); + assertEquals(1, InvocationGuard.guardInvocations); assertEquals(42, executeWith(root, Integer.MAX_VALUE, 1)); assertEquals(1, InvocationGuard.specializedInvocations); assertEquals(1, InvocationGuard.genericInvocations); + assertEquals(2, InvocationGuard.guardInvocations); } @NodeChildren({@NodeChild("value0"), @NodeChild("value1")}) public abstract static class InvocationGuard extends ValueNode { + static int guardInvocations = 0; static int specializedInvocations = 0; static int genericInvocations = 0; boolean guard(int value0, int value1) { + guardInvocations++; return value0 != Integer.MAX_VALUE; }