diff --git a/part-13/build.gradle b/part-13/build.gradle index 92abe3e1..34f6fda4 100644 --- a/part-13/build.gradle +++ b/part-13/build.gradle @@ -6,7 +6,6 @@ plugins { dependencies { antlr "org.antlr:antlr4:$antlr_version" implementation "org.graalvm.js:js:$graal_version" - implementation "org.graalvm.truffle:truffle-sl:$graal_version" implementation "org.graalvm.tools:profiler:$graal_version" implementation "org.apache.commons:commons-text:1.10.0" } diff --git a/part-13/src/jmh/java/com/endoflineblog/truffle/part_13/CounterThisBenchmark.java b/part-13/src/jmh/java/com/endoflineblog/truffle/part_13/CounterThisBenchmark.java index 88b8406b..a3f7bde2 100644 --- a/part-13/src/jmh/java/com/endoflineblog/truffle/part_13/CounterThisBenchmark.java +++ b/part-13/src/jmh/java/com/endoflineblog/truffle/part_13/CounterThisBenchmark.java @@ -24,18 +24,6 @@ public void setup() { this.truffleContext.eval("js", COUNTER_CLASS); this.truffleContext.eval("js", COUNT_WITH_THIS_IN_FOR); - - this.truffleContext.eval("sl", "" + - "function countWithThisInFor(n) { " + - " counter = new(); " + - " i = 1; " + - " while (i <= n) { " + - " counter.count = i; " + - " i = i + 1; " + - " } " + - " return counter.count; " + - "}" - ); } private static final String COUNT_WITH_THIS_IN_FOR = "" + @@ -56,13 +44,4 @@ public int count_with_this_in_for_ezs() { public int count_with_this_in_for_js() { return this.truffleContext.eval("js", "countWithThisInFor(" + INPUT + ");").asInt(); } - - @Benchmark - public int count_with_this_in_for_sl() { - return this.truffleContext.eval("sl", "" + - "function main() { " + - " return countWithThisInFor(" + INPUT + ");" + - "}" - ).asInt(); - } } diff --git a/part-13/src/test/java/com/endoflineblog/truffle/part_13/FieldsTest.java b/part-13/src/test/java/com/endoflineblog/truffle/part_13/FieldsTest.java index 33600938..1327b20b 100644 --- a/part-13/src/test/java/com/endoflineblog/truffle/part_13/FieldsTest.java +++ b/part-13/src/test/java/com/endoflineblog/truffle/part_13/FieldsTest.java @@ -187,26 +187,4 @@ public void benchmark_returns_its_input() { ); assertEquals(input, result.asInt()); } - - @Test - public void simplelang_benchmark_returns_its_input() { - var input = 100; - this.context.eval("sl", "" + - "function countWithThisInFor(n) { " + - " counter = new(); " + - " i = 1; " + - " while (i <= n) { " + - " counter.count = i; " + - " i = i + 1; " + - " } " + - " return counter.count; " + - "}"); - - Value result = this.context.eval("sl", "" + - "function main() { " + - " return countWithThisInFor(" + input + ");" + - "}" - ); - assertEquals(input, result.asInt()); - } }