Mercurial > hg > truffle
changeset 19300:67ab244ab689
Truffle-DSL: fix formatting issues.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Wed, 11 Feb 2015 18:33:49 +0100 |
parents | 8e4f683e16d9 |
children | a79a3e467245 |
files | graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Specialization.java |
diffstat | 2 files changed, 9 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java Wed Feb 11 18:10:02 2015 +0100 +++ b/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Cached.java Wed Feb 11 18:33:49 2015 +0100 @@ -90,7 +90,7 @@ * CompilerAsserts.compilationConstant(cachedOperand); * ... * } - * + * * Example executions: * execute(1) => doCached(1, 1) // new instantiation, localOperand is bound to 1 * execute(0) => doCached(0, 1) @@ -138,16 +138,16 @@ * instantiated. Alternatively if the <code>contains</code> relation is omitted then all * <code>doCached</code> instances remain but no new instances are created. * - * <pre> + * <code> * @Specialization(guards = "==(operand, cachedOperand)") * void doCached(int operand, @Cached("operand") int cachedOperand) { * 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 @@ -155,7 +155,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 @@ -164,7 +164,7 @@ * execute(3) => doNormal(3) // new instantiation of doNormal due to limit overflow * execute(1) => doCached(1, 1) * - * </pre> + * </code> * * </li> * <li> @@ -175,7 +175,7 @@ * @Specialization * void s(int operand, @Cached("transformLocal(operand)") int cachedOperand) { * } - * + * * int transformLocal(int operand) { * return operand & 0x42; * } @@ -191,9 +191,9 @@ * void s(Object operand, @Cached("new()") OtherNode someNode) { * someNode.execute(operand); * } - * + * * static class OtherNode extends Node { - * + * * public String execute(Object value) { * throw new UnsupportedOperationException(); * }
--- a/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Specialization.java Wed Feb 11 18:10:02 2015 +0100 +++ b/graal/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/Specialization.java Wed Feb 11 18:33:49 2015 +0100 @@ -158,13 +158,11 @@ * int doAddNoOverflow(int a, int b) { * return ExactMath.addExact(a, b); * } - * * @Specialization * long doAddWithOverflow(int a, int b) { * return a + b; * } * ... - * * Example executions: * execute(Integer.MAX_VALUE - 1, 1) => doAddNoOverflow(Integer.MAX_VALUE - 1, 1) * execute(Integer.MAX_VALUE, 1) => doAddNoOverflow(Integer.MAX_VALUE, 1) @@ -196,18 +194,15 @@ * void doDivPowerTwo(int a, int b) { * return a >> 1; * } - * * @Specialization(contains ="doDivPowerTwo", guards = "b > 0") * void doDivPositive(int a, int b) { * return a / b; * } * ... - * * Example executions with contains="doDivPowerTwo": * execute(4, 2) => doDivPowerTwo(4, 2) * execute(9, 3) => doDivPositive(9, 3) // doDivPowerTwo instances get removed * execute(4, 2) => doDivPositive(4, 2) - * * Same executions without contains="doDivPowerTwo" * execute(4, 2) => doDivPowerTwo(4, 2) * execute(9, 3) => doDivPositive(9, 3) @@ -253,7 +248,6 @@ * assert operand <= 42; * return operand & 1 == 1; * } - * * @Specialization(guards = {"operand <= 42", "acceptOperand(operand)"}) * void doSpecialization(int operand) {...} * </pre> @@ -301,7 +295,6 @@ * abstract Assumption getUnmodifiedAssuption(); * ... * } - * * @Specialization(guards = "operand.getShape() == cachedShape", assumptions = "cachedShape.getUnmodifiedAssumption()") * void doAssumeUnmodifiedShape(DynamicObject operand, @Cached("operand.getShape()") Shape cachedShape) {...} * </pre> @@ -345,7 +338,6 @@ * static int getCacheLimit() { * return Integer.parseInt(System.getProperty("language.cacheLimit")); * } - * * @Specialization(guards = "operand == cachedOperand", limit = "getCacheLimit()") * void doCached(Object operand, @Cached("operand") Object cachedOperand) {...} * </pre>