Mercurial > hg > graal-jvmci-8
changeset 17441:3a586c78a807
Merge.
author | Chris Seaton <chris.seaton@oracle.com> |
---|---|
date | Tue, 14 Oct 2014 16:48:09 +0100 |
parents | 935de03661c1 (diff) b0e8bc17af1b (current diff) |
children | ecc27b9d2510 |
files | |
diffstat | 3 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/utilities/NeverValidAssumptionTest.java Tue Oct 14 16:09:04 2014 +0200 +++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/utilities/NeverValidAssumptionTest.java Tue Oct 14 16:48:09 2014 +0100 @@ -50,10 +50,12 @@ assertFalse(assumption.isValid()); } - @Test(expected = UnsupportedOperationException.class) - public void testCannotInvalidate() { + @Test + public void testInvalidateDoesNothing() { final NeverValidAssumption assumption = NeverValidAssumption.INSTANCE; assumption.invalidate(); + assumption.invalidate(); + assumption.invalidate(); } }
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/AssumedValue.java Tue Oct 14 16:09:04 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/AssumedValue.java Tue Oct 14 16:48:09 2014 +0100 @@ -29,9 +29,12 @@ import com.oracle.truffle.api.nodes.*; /** - * A {@link CompilationFinal} value combined with an {@link Assumption} to notify when it changes. - * Note that you should be careful that modifications to this value do not cause deoptimization - * loops. This could be by using a value that is monotonic. + * A value that the compiler can assume is constant, but can be changed by invalidation. + * <p> + * Compiled code that uses the value will be invalidated each time the value changes, so you should + * take care to only change values infrequently, or to monitor the number of times the value has + * changed and at some point to replace the value with something more generic so that it does not + * have to be changed and code does not have to keep being recompiled. */ public class AssumedValue<T> {
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/NeverValidAssumption.java Tue Oct 14 16:09:04 2014 +0200 +++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/NeverValidAssumption.java Tue Oct 14 16:48:09 2014 +0100 @@ -45,7 +45,6 @@ @Override public void invalidate() { - throw new UnsupportedOperationException("Cannot invalidate this assumption - it is never valid"); } @Override