changeset 18309:d079b2af3a15

Truffle: more explicit warning about isCompilationConstant.
author Chris Seaton <chris.seaton@oracle.com>
date Sat, 08 Nov 2014 22:03:36 +0000
parents 7c7930eb4def
children 36fb9592c13b
files graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java	Sat Nov 08 15:28:58 2014 +0100
+++ b/graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java	Sat Nov 08 22:03:36 2014 +0000
@@ -114,6 +114,12 @@
      * </code>
      * </pre>
      *
+     * Note that optimizations that a compiler will apply to code that is conditional on
+     * <code>isCompilationConstant</code> may be limited. For this reason
+     * <code>isCompilationConstant</code> is not recommended for use to select between alternate
+     * implementations of functionality depending on whether a value is constant. Instead, it is
+     * intended for use as a diagnostic mechanism, such as illustrated above.
+     *
      * @param value
      * @return {@code true} when given value is seen as compilation constant, {@code false} if not
      *         compilation constant.