# HG changeset patch # User Chris Seaton # Date 1415484216 0 # Node ID d079b2af3a15f48a6a00298444a6877a0bd05898 # Parent 7c7930eb4def6da57c6a89248ffa5a582458c10e Truffle: more explicit warning about isCompilationConstant. diff -r 7c7930eb4def -r d079b2af3a15 graal/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java --- 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 @@ * * * + * Note that optimizations that a compiler will apply to code that is conditional on + * isCompilationConstant may be limited. For this reason + * isCompilationConstant 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.