Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Truffle] -Xtruffle.translator.print_full_asts option.
  • Loading branch information
chrisseaton committed Dec 23, 2014
1 parent eafc830 commit 42231a1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
Expand Up @@ -176,6 +176,11 @@ public MethodDefinitionNode compileFunctionNode(SourceSection sourceSection, Str
NodeUtil.printCompactTree(System.err, rootNode);
}

if (PRINT_FULL_AST_METHOD_NAMES.contains(methodName)) {
System.err.println(methodName);
NodeUtil.printTree(System.err, rootNode);
}

if (isBlock) {
final CallTarget callTarget = Truffle.getRuntime().createCallTarget(rootNode);
final CallTarget callTargetForMethods = withoutBlockDestructureSemantics(callTarget);
Expand Down
Expand Up @@ -24,6 +24,7 @@
public abstract class Translator extends org.jruby.ast.visitor.AbstractNodeVisitor<RubyNode> {

public static final Set<String> PRINT_AST_METHOD_NAMES = new HashSet<>(Arrays.asList(Options.TRUFFLE_TRANSLATOR_PRINT_AST.load().split(",")));
public static final Set<String> PRINT_FULL_AST_METHOD_NAMES = new HashSet<>(Arrays.asList(Options.TRUFFLE_TRANSLATOR_PRINT_FULL_AST.load().split(",")));
public static final Set<String> PRINT_PARSE_TREE_METHOD_NAMES = new HashSet<>(Arrays.asList(Options.TRUFFLE_TRANSLATOR_PRINT_PARSE_TREE.load().split(",")));

protected final RubyNode currentNode;
Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Expand Up @@ -153,6 +153,7 @@ public class Options {
public static final Option<Boolean> TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_CLONED = bool(TRUFFLE, "truffle.call.method_missing_always_cloned", true, "Always clone #method_missing call targets.");
public static final Option<Boolean> TRUFFLE_DISPATCH_METHODMISSING_ALWAYS_INLINED = bool(TRUFFLE, "truffle.call.method_missing_always_inlined", true, "Always inline #method_missing call targets.");
public static final Option<String> TRUFFLE_TRANSLATOR_PRINT_AST = string(TRUFFLE, "truffle.translator.print_asts", "", "Comma delimited list of method names to print the AST of after translation.");
public static final Option<String> TRUFFLE_TRANSLATOR_PRINT_FULL_AST = string(TRUFFLE, "truffle.translator.print_full_asts", "", "Comma delimited list of method names to print the full AST of after translation.");
public static final Option<String> TRUFFLE_TRANSLATOR_PRINT_PARSE_TREE = string(TRUFFLE, "truffle.translator.print_parse_trees", "", "Comma delimited list of method names to print the JRuby parse tree of before translation.");

public static final Option<Boolean> NATIVE_ENABLED = bool(NATIVE, "native.enabled", true, "Enable/disable native code, including POSIX features and C exts.");
Expand Down

0 comments on commit 42231a1

Please sign in to comment.