From 071a14a894ffbcc1ed53f3c5c7a450ed661cbf52 Mon Sep 17 00:00:00 2001 From: Jaroslav Tulach Date: Thu, 19 Dec 2024 19:25:36 +0100 Subject: [PATCH] Ensure isAllTypes is compilation constant (#11913) Fixes #11901 up by making sure `isAllTypes()` is a compilation constant. --- .../node/typecheck/AbstractTypeCheckNode.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/node/typecheck/AbstractTypeCheckNode.java b/engine/runtime/src/main/java/org/enso/interpreter/node/typecheck/AbstractTypeCheckNode.java index 1dba321b3649..1246a3f89b90 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/node/typecheck/AbstractTypeCheckNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/node/typecheck/AbstractTypeCheckNode.java @@ -1,7 +1,9 @@ package org.enso.interpreter.node.typecheck; +import com.oracle.truffle.api.CompilerAsserts; import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.frame.VirtualFrame; +import com.oracle.truffle.api.nodes.ExplodeLoop; import com.oracle.truffle.api.nodes.Node; import java.util.List; import org.enso.interpreter.node.ExpressionNode; @@ -29,11 +31,16 @@ abstract Object executeCheckOrConversion( abstract String expectedTypeMessage(); + @ExplodeLoop final boolean isAllTypes() { Node p = this; + CompilerAsserts.compilationConstant(p); for (; ; ) { if (p instanceof TypeCheckValueNode vn) { - return vn.isAllTypes(); + CompilerAsserts.compilationConstant(vn); + var allTypes = vn.isAllTypes(); + CompilerAsserts.compilationConstant(allTypes); + return allTypes; } p = p.getParent(); }