Mercurial > hg > truffle
comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/CompilerDirectives.java @ 22211:863f7bb5f645
add CompilerDirectives.isPartialEvaluationConstant as the counterpart to CompilerAsserts.partialEvaluationConstant
author | Andreas Woess <andreas.woess@oracle.com> |
---|---|
date | Wed, 30 Sep 2015 14:05:10 +0200 |
parents | dc83cc1f94f2 |
children | bc1e026ef5b1 |
comparison
equal
deleted
inserted
replaced
22210:3a96086cf698 | 22211:863f7bb5f645 |
---|---|
95 * @param value | 95 * @param value |
96 * @return {@code true} when given value is seen as compilation constant, {@code false} if not | 96 * @return {@code true} when given value is seen as compilation constant, {@code false} if not |
97 * compilation constant. | 97 * compilation constant. |
98 */ | 98 */ |
99 public static boolean isCompilationConstant(Object value) { | 99 public static boolean isCompilationConstant(Object value) { |
100 return CompilerDirectives.inInterpreter(); | |
101 } | |
102 | |
103 /** | |
104 * Returns a boolean indicating whether or not a given value is seen as constant during the | |
105 * initial partial evaluation phase. If this method is called in the interpreter this method | |
106 * will always return <code>true</code>. | |
107 * | |
108 * @param value | |
109 * @return {@code true} when given value is seen as compilation constant, {@code false} if not | |
110 * compilation constant. | |
111 */ | |
112 public static boolean isPartialEvaluationConstant(Object value) { | |
100 return CompilerDirectives.inInterpreter(); | 113 return CompilerDirectives.inInterpreter(); |
101 } | 114 } |
102 | 115 |
103 /** | 116 /** |
104 * Directive for the compiler that the given runnable should only be executed in the interpreter | 117 * Directive for the compiler that the given runnable should only be executed in the interpreter |