diff truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java @ 22046:e7c2d36daf72

TruffleLanguage.parse method to convert a source to CallTarget. Basic caching to make sure the code is shared among tenants in one JVM.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Thu, 30 Jul 2015 17:36:34 +0200
parents c07e64ecb528
children 503529c65456
line wrap: on
line diff
--- a/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java	Thu Jul 30 17:16:59 2015 +0200
+++ b/truffle/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTckTest.java	Thu Jul 30 17:36:34 2015 +0200
@@ -70,6 +70,14 @@
             "function apply(f) {\n" +
             "  return f(18, 32) + 10;\n" +
             "}\n" +
+            "function cnt() {\n" +
+            "  return 0;\n" +
+            "}\n" +
+            "function count() {\n" +
+            "  n = cnt() + 1;\n" +
+            "  defineFunction(\"function cnt() { return \" + n + \"; }\");\n" +
+            "  return n;\n" +
+            "}\n" +
             "function null() {\n" +
             "}\n"
         );
@@ -111,4 +119,9 @@
             "}\n";
         // @formatter:on
     }
+
+    @Override
+    protected String countInvocations() {
+        return "count";
+    }
 }