Skip to content

Commit

Permalink
Showing 3 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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;
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -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.");

0 comments on commit 42231a1

Please sign in to comment.