diff truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/DSLShare.java @ 21966:5023b913e2ba

Help the partial evaluator / language developer by marking API methods as neverPartOfCompilation() when they are too complicated to be compiled.
author Christian Wimmer <christian.wimmer@oracle.com>
date Mon, 22 Jun 2015 10:16:27 -0700
parents 9c8c0937da41
children dc83cc1f94f2
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/DSLShare.java	Mon Jun 22 10:15:05 2015 -0700
+++ b/truffle/com.oracle.truffle.api.dsl/src/com/oracle/truffle/api/dsl/internal/DSLShare.java	Mon Jun 22 10:16:27 2015 -0700
@@ -27,12 +27,15 @@
 import java.util.*;
 import java.util.concurrent.*;
 
+import com.oracle.truffle.api.*;
 import com.oracle.truffle.api.nodes.*;
 
 /** Contains utility classes shared across generated DSLNode implementations. */
 public class DSLShare {
 
     public static boolean isExcluded(Node currentNode, DSLMetadata otherMetadata) {
+        CompilerAsserts.neverPartOfCompilation();
+
         assert otherMetadata.getExcludedBy().length > 0 : "At least one exclude must be defined for isIncluded.";
         Node cur = findRoot(currentNode);
         while (cur != null) {
@@ -52,6 +55,8 @@
     }
 
     public static <T extends Node & DSLNode> T rewrite(final Node thisNode, final T newNode, final String message) {
+        CompilerAsserts.neverPartOfCompilation();
+
         return thisNode.atomic(new Callable<T>() {
             public T call() {
                 assert newNode != null;
@@ -72,6 +77,8 @@
 
     @SuppressWarnings("unchecked")
     public static <T extends Node> T findRoot(T node) {
+        CompilerAsserts.neverPartOfCompilation();
+
         Node prev = node;
         Node cur;
         do {
@@ -92,6 +99,8 @@
     }
 
     public static <T extends Node & DSLNode> T rewriteUninitialized(final Node uninitialized, final T newNode) {
+        CompilerAsserts.neverPartOfCompilation();
+
         return uninitialized.atomic(new Callable<T>() {
             public T call() {
                 Node prev = getPrevious(uninitialized);
@@ -108,6 +117,8 @@
 
     public static <T extends Node & DSLNode> T rewriteToPolymorphic(final Node oldNode, final DSLNode uninitializedDSL, final T polymorphic, final DSLNode currentCopy, final DSLNode newNodeDSL,
                     final String message) {
+        CompilerAsserts.neverPartOfCompilation();
+
         return oldNode.atomic(new Callable<T>() {
             public T call() {
                 assert getNext(oldNode) == null;