changeset 17442:ecc27b9d2510

Merge.
author Chris Seaton <chris.seaton@oracle.com>
date Tue, 14 Oct 2014 18:12:24 +0100
parents 3a586c78a807 (diff) b8d89559915d (current diff)
children 90c6a996f9cd
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 17:46:18 2014 +0200
+++ b/graal/com.oracle.truffle.api.test/src/com/oracle/truffle/api/test/utilities/NeverValidAssumptionTest.java	Tue Oct 14 18:12:24 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 17:46:18 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/AssumedValue.java	Tue Oct 14 18:12:24 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 17:46:18 2014 +0200
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/utilities/NeverValidAssumption.java	Tue Oct 14 18:12:24 2014 +0100
@@ -45,7 +45,6 @@
 
     @Override
     public void invalidate() {
-        throw new UnsupportedOperationException("Cannot invalidate this assumption - it is never valid");
     }
 
     @Override