Mercurial > hg > truffle
diff truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java @ 22503:828c67903db2
Moving profiles into their own project to ensure the core API doesn't reference these utility classes.
author | Jaroslav Tulach <jaroslav.tulach@oracle.com> |
---|---|
date | Thu, 17 Dec 2015 10:01:38 +0100 |
parents | a63bda98cfdb |
children |
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java Wed Dec 16 15:32:23 2015 -0800 +++ b/truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java Thu Dec 17 10:01:38 2015 +0100 @@ -26,7 +26,6 @@ import com.oracle.truffle.api.CompilerAsserts; import com.oracle.truffle.api.nodes.Node; -import com.oracle.truffle.api.profiles.BranchProfile; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -93,7 +92,7 @@ * CompilerAsserts.compilationConstant(cachedOperand); * ... * } - * + * * Example executions: * execute(1) => doCached(1, 1) // new instantiation, localOperand is bound to 1 * execute(0) => doCached(0, 1) @@ -119,7 +118,7 @@ * CompilerAsserts.compilationConstant(cachedOperand); * ... * } - * + * * Example executions: * execute(0) => doCached(0, 0) // new instantiation, cachedOperand is bound to 0 * execute(1) => doCached(1, 1) // new instantiation, cachedOperand is bound to 1 @@ -147,10 +146,10 @@ * CompilerAsserts.compilationConstant(cachedOperand); * ... * } - * + * * @Specialization(contains = "doCached") * void doNormal(int operand) {...} - * + * * Example executions with contains = "doCached": * execute(0) => doCached(0, 0) // new instantiation, cachedOperand is bound to 0 * execute(1) => doCached(1, 1) // new instantiation, cachedOperand is bound to 1 @@ -158,7 +157,7 @@ * execute(2) => doCached(2, 2) // new instantiation, cachedOperand is bound to 2 * execute(3) => doNormal(3) // new instantiation of doNormal due to limit overflow; doCached gets removed. * execute(1) => doNormal(1) - * + * * Example executions without contains = "doCached": * execute(0) => doCached(0, 0) // new instantiation, cachedOperand is bound to 0 * execute(1) => doCached(1, 1) // new instantiation, cachedOperand is bound to 1 @@ -166,7 +165,7 @@ * execute(2) => doCached(2, 2) // new instantiation, cachedOperand is bound to 2 * execute(3) => doNormal(3) // new instantiation of doNormal due to limit overflow * execute(1) => doCached(1, 1) - * + * * </code> * * </li> @@ -178,7 +177,7 @@ * @Specialization * void s(int operand, {@code @Cached}("transformLocal(operand)") int cachedOperand) { * } - * + * * int transformLocal(int operand) { * return operand & 0x42; * } @@ -194,9 +193,9 @@ * void s(Object operand, {@code @Cached}("new()") OtherNode someNode) { * someNode.execute(operand); * } - * + * * static class OtherNode extends Node { - * + * * public String execute(Object value) { * throw new UnsupportedOperationException(); * } @@ -208,7 +207,8 @@ * <li> * Java types without public constructor but with a static factory methods can be initialized by * just referencing its static factory method and its parameters. In this case - * {@link BranchProfile#create()} is used to instantiate the {@link BranchProfile} instance. + * {@link com.oracle.truffle.api.profiles.BranchProfile#create()} is used to instantiate the + * {@link com.oracle.truffle.api.profiles.BranchProfile} instance. * * <pre> * @Specialization