changeset 16085:0cdce0e2d122

Truffle: Added -G:+TraceTruffleCompilationAST flag.
author Christian Humer <christian.humer@gmail.com>
date Wed, 11 Jun 2014 18:15:45 +0200
parents b37dbfdfbbfb
children 6eef506c173d
files CHANGELOG.md graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG.md	Tue Jun 10 12:11:48 2014 +0200
+++ b/CHANGELOG.md	Wed Jun 11 18:15:45 2014 +0200
@@ -9,6 +9,7 @@
 
 ### Truffle
 * `truffle.jar`: strip out build-time only dependency into a seperated JAR file (`truffle-dsl-processor.jar`)
+* New flag -G:+TraceTruffleCompilationAST to print the AST before compilation.
 * ...
 
 ## Version 0.3
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java	Tue Jun 10 12:11:48 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java	Wed Jun 11 18:15:45 2014 +0200
@@ -111,8 +111,11 @@
     public void compileMethodImpl(final OptimizedCallTarget compilable) {
         final StructuredGraph graph;
 
-        if (TraceTruffleCompilation.getValue()) {
+        if (TraceTruffleCompilation.getValue() || TraceTruffleCompilationAST.getValue()) {
             OptimizedCallTargetLog.logOptimizingStart(compilable);
+            if (TraceTruffleCompilationAST.getValue()) {
+                NodeUtil.printCompactTree(OptimizedCallTarget.OUT, compilable.getRootNode());
+            }
         }
 
         long timeCompilationStarted = System.nanoTime();
--- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java	Tue Jun 10 12:11:48 2014 +0200
+++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java	Wed Jun 11 18:15:45 2014 +0200
@@ -87,6 +87,8 @@
     public static final OptionValue<Boolean> TraceTruffleCompilationHistogram = new OptionValue<>(false);
     @Option(help = "Prints out all polymorphic and generic nodes after compilation.")
     public static final OptionValue<Boolean> TraceTruffleCompilationPolymorphism = new OptionValue<>(false);
+    @Option(help = "Prints out all polymorphic and generic nodes after compilation.")
+    public static final OptionValue<Boolean> TraceTruffleCompilationAST = new OptionValue<>(false);
     @Option(help = "")
     public static final OptionValue<Boolean> TraceTruffleExpansion = new OptionValue<>(false);
     @Option(help = "")