# HG changeset patch # User Michael Van De Vanter # Date 1447287083 28800 # Node ID 045c31f9f133ba43c46ba3db7e4883b7b821f086 # Parent 3edc03012975d630e8b6add12c1e21fd1085498b Truffle/SL: remove some obsolete/unworkable demo code from SLLanguage diff -r 3edc03012975 -r 045c31f9f133 truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLLanguage.java --- a/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLLanguage.java Wed Nov 11 16:10:49 2015 -0800 +++ b/truffle/com.oracle.truffle.sl/src/com/oracle/truffle/sl/SLLanguage.java Wed Nov 11 16:11:23 2015 -0800 @@ -184,17 +184,6 @@ * with the new version. * */ - -/* - * - *

Tools:
The use of some of Truffle's support for developer tools (based on the - * Truffle {@linkplain Instrumenter Instrumentation Framework}) are demonstrated in this file, for - * example:

In each - * case, the tool is enabled if a corresponding local boolean variable in this file is set to {@code - * true}. Results are printed at the end of the execution using each tool's default - * printer. - */ @TruffleLanguage.Registration(name = "SL", version = "0.5", mimeType = "application/x-sl") public final class SLLanguage extends TruffleLanguage { public static final String builtinKind = "SL builtin"; @@ -218,11 +207,6 @@ return context; } - /* Small tools that can be installed for demonstration */ - // private static NodeExecCounter nodeExecCounter = null; - // private static NodeExecCounter statementExecCounter = null; - // private static CoverageTracker coverageTracker = null; - /** * The main entry point. Use the mx command "mx sl" to run it with the correct class path setup. */ @@ -230,8 +214,6 @@ PolyglotEngine vm = PolyglotEngine.newBuilder().build(); assert vm.getLanguages().containsKey("application/x-sl"); - setupToolDemos(); - int repeats = 1; if (args.length >= 2) { repeats = Integer.parseInt(args[1]); @@ -251,7 +233,6 @@ while (repeats-- > 0) { main.invoke(null); } - reportToolDemos(); } /** @@ -501,38 +482,4 @@ public SLContext findContext0(Node contextNode) { return findContext(contextNode); } - - // TODO (mlvdv) remove the static hack when we no longer have the static demo variables - private static void setupToolDemos() { - // if (nodeExecCounts) { - // nodeExecCounter = new NodeExecCounter(); - // nodeExecCounter.install(); - // } - // - // if (statementCounts) { - // statementExecCounter = new NodeExecCounter(StandardSyntaxTag.STATEMENT); - // statementExecCounter.install(); - // } - // - // if (coverage) { - // coverageTracker = new CoverageTracker(); - // coverageTracker.install(); - // } - } - - private static void reportToolDemos() { - // if (nodeExecCounter != null) { - // nodeExecCounter.print(System.out); - // nodeExecCounter.dispose(); - // } - // if (statementExecCounter != null) { - // statementExecCounter.print(System.out); - // statementExecCounter.dispose(); - // } - // if (coverageTracker != null) { - // coverageTracker.print(System.out); - // coverageTracker.dispose(); - // } - } - }