Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 677d414a4299
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 49ef265b38d0
Choose a head ref
  • 5 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 6, 2016

  1. Copy the full SHA
    877da3b View commit details
  2. Copy the full SHA
    d882ecb View commit details
  3. Copy the full SHA
    0233cf8 View commit details
  4. Copy the full SHA
    21653aa View commit details
  5. Copy the full SHA
    49ef265 View commit details
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
@@ -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