File tree Expand file tree Collapse file tree 4 files changed +10
-0
lines changed
lkql_jit/language/src/main/java/com/adacore/lkql_jit Expand file tree Collapse file tree 4 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1111import com .adacore .lkql_jit .runtime .values .LKQLUnit ;
1212import com .adacore .lkql_jit .runtime .values .lists .BaseLKQLList ;
1313import com .adacore .lkql_jit .utils .LKQLTypesHelper ;
14+ import com .oracle .truffle .api .CompilerDirectives ;
1415import com .oracle .truffle .api .dsl .Fallback ;
1516import com .oracle .truffle .api .dsl .Specialization ;
1617import com .oracle .truffle .api .nodes .Node ;
@@ -49,6 +50,11 @@ protected boolean onLKQLUnit(LKQLUnit unit) {
4950
5051 @ Specialization
5152 protected boolean onNode (LangkitSupport .NodeInterface node ) {
53+ return checkNode (node );
54+ }
55+
56+ @ CompilerDirectives .TruffleBoundary
57+ protected boolean checkNode (LangkitSupport .NodeInterface node ) {
5258 return !node .isNone ();
5359 }
5460
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ public class LKQLProperty extends BasicLKQLValue {
3737 // ----- Constructors -----
3838
3939 /** Create a new LKQL property from its name and associated node. */
40+ @ CompilerDirectives .TruffleBoundary
4041 public LKQLProperty (final String name , final LangkitSupport .NodeInterface node ) {
4142 this .name = name ;
4243 this .description = node .getFieldDescription (name );
Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ protected BaseLKQLList() {}
4141 *
4242 * @throws InvalidIndexException If the provided index is not in the list bounds.
4343 */
44+ @ CompilerDirectives .TruffleBoundary
4445 public abstract Object get (long i ) throws InvalidIndexException ;
4546
4647 /** Get the iterator for the list. */
@@ -147,6 +148,7 @@ public boolean isBoolean() {
147148
148149 /** Get the boolean representation of the list. */
149150 @ ExportMessage
151+ @ CompilerDirectives .TruffleBoundary
150152 public boolean asBoolean () {
151153 try {
152154 this .get (0 );
Original file line number Diff line number Diff line change @@ -156,6 +156,7 @@ public static String fromJava(Object obj) {
156156 * @param defaultValue The default value to return.
157157 * @return The string representing the type in the LKQL language.
158158 */
159+ @ CompilerDirectives .TruffleBoundary
159160 public static String fromJava (Object obj , String defaultValue ) {
160161 if (LKQLTypeSystemGen .isUnit (obj )) {
161162 return LKQL_UNIT ;
You can’t perform that action at this time.
0 commit comments