diff graal/com.oracle.graal.truffle.test/sl/TestCompilationThreshold.sl @ 17007:004e3f0a0517

Truffle: added new infrastructure for graal truffle runtime tests using SL.
author Christian Humer <christian.humer@gmail.com>
date Mon, 01 Sep 2014 20:08:19 +0200
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.truffle.test/sl/TestCompilationThreshold.sl	Mon Sep 01 20:08:19 2014 +0200
@@ -0,0 +1,19 @@
+/*
+ * This test verifies the compilation threshold property.
+ */
+function test() {
+}  
+
+function main() {  
+    /* TODO disableSplitting is required because otherwise it needs more calls to warm up. This still needs to be fixed. */
+    disableSplitting(test); 
+    threshold = getOption("TruffleCompilationThreshold");
+    i = 0;
+    while (i < threshold -1) {
+        test();
+        i = i + 1;
+    }
+    assertFalse(isOptimized(waitForOptimization(test)));
+    test();                         // triggers compilation
+    assertTrue(isOptimized(waitForOptimization(test)));
+}