Skip to content

Commit

Permalink
Showing 6 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ public Channel getRemainingAsChannel() {

@Override
public IRubyObject getRemainingAsIO() {
if (scriptLines == null) return null;
return new RubyIO(scriptLines.getRuntime(), getRemainingAsChannel());
}
}
2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -267,6 +267,8 @@ public class Options {
public static final Option<Boolean> TRUFFLE_CALL_GRAPH = bool(TRUFFLE, "truffle.callgraph", false, "Maintain a call graph.");
public static final Option<String> TRUFFLE_CALL_GRAPH_WRITE = string(TRUFFLE, "truffle.callgraph.write", "File to write the call garph to on exit.");

public static final Option<Boolean> TRUFFLE_GRAAL_WARNING_UNLESS = bool(TRUFFLE, "truffle.graal.warn_unless", false, "Warn unless the JVM has the Graal compiler.");

public static String dump() {
return "# JRuby configuration options with current values\n" +
Option.formatValues(_loadedOptions);
4 changes: 4 additions & 0 deletions truffle/src/main/java/org/jruby/truffle/runtime/Options.java
Original file line number Diff line number Diff line change
@@ -72,4 +72,8 @@ public class Options {
public final boolean CALL_GRAPH = org.jruby.util.cli.Options.TRUFFLE_CALL_GRAPH.load();
public final String CALL_GRAPH_WRITE = org.jruby.util.cli.Options.TRUFFLE_CALL_GRAPH_WRITE.load();

// Graal

public final boolean GRAAL_WARNING_UNLESS = org.jruby.util.cli.Options.TRUFFLE_GRAAL_WARNING_UNLESS.load();

}
10 changes: 5 additions & 5 deletions truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
Original file line number Diff line number Diff line change
@@ -136,9 +136,9 @@ public RubyContext(Ruby runtime, TruffleLanguage.Env env) {

compilerOptions = Truffle.getRuntime().createCompilerOptions();

if (!onGraal()) {
System.err.println("WARNING: JRuby+Truffle is designed to be run with a JVM that has the Graal compiler. " +
"The compilation is disabled Without the Graal compiler and it runs much slower. " +
if (!onGraal() && options.GRAAL_WARNING_UNLESS) {
System.err.println("WARNING: JRuby+Truffle is designed to be used with a JVM that has the Graal compiler. " +
"Without the Graal compiler, performance will be drastically reduced. " +
"See https://github.com/jruby/jruby/wiki/Truffle-FAQ#how-do-i-get-jrubytruffle");
}

@@ -712,8 +712,8 @@ public CrtExterns getCrtExterns() {
return crtExterns;
}

public static void writeToFile(String fileName, String message) {
try (PrintStream stream = new PrintStream(fileName, StandardCharsets.UTF_8.name())) {
public static void appendToFile(String fileName, String message) {
try (PrintStream stream = new PrintStream(new FileOutputStream(fileName, true), true, StandardCharsets.UTF_8.name())) {
stream.println(message);
} catch (FileNotFoundException | UnsupportedEncodingException e) {
e.printStackTrace();
Original file line number Diff line number Diff line change
@@ -1982,10 +1982,6 @@ public RubyNode visitMultipleAsgnNode(org.jruby.ast.MultipleAsgnNode node) {

// TODO CS 5-Jan-15 we shouldn't be doing this kind of low level optimisation or pattern matching - EA should do it for us

if (sourceSection.getSource().getName().endsWith("test.rb")) {
rhsTranslated = rhsTranslated;
}

if (preArray != null
&& node.getPost() == null
&& node.getRest() == null
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ public RubyRootNode parse(RubyContext context, Source source, Encoding defaultEn

boolean isInlineSource = parserContext == ParserContext.SHELL;
boolean isEvalParse = parserContext == ParserContext.EVAL || parserContext == ParserContext.INLINE || parserContext == ParserContext.MODULE;
final org.jruby.parser.ParserConfiguration parserConfiguration = new org.jruby.parser.ParserConfiguration(context.getRuntime(), 0, isInlineSource, !isEvalParse, true);
final org.jruby.parser.ParserConfiguration parserConfiguration = new org.jruby.parser.ParserConfiguration(context.getRuntime(), 0, isInlineSource, !isEvalParse, false);
parserConfiguration.setDefaultEncoding(defaultEncoding);

// Parse to the JRuby AST

0 comments on commit 9bbce9d

Please sign in to comment.