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: 61379810b9d0
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 07f4be8ae13c
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Nov 7, 2016

  1. Copy the full SHA
    b1823d8 View commit details
  2. Copy the full SHA
    07f4be8 View commit details
5 changes: 5 additions & 0 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -188,6 +188,7 @@ declare -a ruby_args
mode=""

JAVA_CLASS_JRUBY_MAIN=org.jruby.Main
JAVA_CLASS_JRUBY_TRUFFLE_MAIN=org.jruby.truffle.Main
java_class=$JAVA_CLASS_JRUBY_MAIN
JAVA_CLASS_NGSERVER=org.jruby.main.NailServerMain

@@ -249,6 +250,10 @@ do
-X+T)
USING_TRUFFLE="true"
;;
-X+TM)
USING_TRUFFLE="true"
java_class=$JAVA_CLASS_JRUBY_TRUFFLE_MAIN
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
4 changes: 4 additions & 0 deletions bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -200,6 +200,10 @@ do
echo "error: -X+T isn't supported in the shell launcher"
exit 1
;;
-X+TM)
echo "error: -X+TM isn't supported in the shell launcher"
exit 1
;;
-Xclassic)
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
Original file line number Diff line number Diff line change
@@ -401,7 +401,7 @@ private void processArgument() {
config.setCompileMode(RubyInstanceConfig.CompileMode.FORCE);
} else if (extendedOption.equals("classic")) {
throw new MainExitException(0, "jruby: the -Xclassic option should have been handled in the launcher");
} else if (extendedOption.equals("+T")) {
} else if (extendedOption.equals("+T") || extendedOption.equals("+TM")) {
Options.PARSER_WARN_GROUPED_EXPRESSIONS.force(Boolean.FALSE.toString());
config.setCompileMode(RubyInstanceConfig.CompileMode.TRUFFLE);
// Make the static option consistent with the compile mode.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/util/cli/OutputStrings.java
Original file line number Diff line number Diff line change
@@ -94,7 +94,7 @@ public static String getExtendedHelp() { return
" -X+C force compilation of all scripts before they are run (except eval)\n" +
" -X+CIR force compilation and use IR runtime\n" +
" -X+JIR JIT compilation and use IR runtime\n" +
" -X+T use Truffle\n" +
" -X+T use Truffle (-X+TM use Truffle's entry point)\n" +
" -Xclassic don't use Truffle, reversing the -X+T option\n" +
" -Xsubstring? list options that contain substring in their name\n" +
" -Xprefix... list options that are prefixed wtih prefix\n" ;
11 changes: 5 additions & 6 deletions truffle/src/main/java/org/jruby/truffle/Main.java
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
*/
package org.jruby.truffle;

import org.jruby.JRubyTruffleInterface;
import org.jruby.Ruby;
import org.jruby.RubyInstanceConfig;

@@ -21,15 +22,13 @@ public static void main(String[] args) {
config.setHardExit(true);
config.processArguments(args);

InputStream in = config.getScriptSource();
String filename = config.displayedFileName();
final InputStream in = config.getScriptSource();
final String filename = config.displayedFileName();

final Ruby runtime = Ruby.newInstance(config);

config.setCompileMode(RubyInstanceConfig.CompileMode.TRUFFLE);
final JRubyTruffleInterface jrubyTruffle = new JRubyTruffleImpl(config);

if (in != null) {
int exitCode = runtime.getTruffleContext().execute(filename);
final int exitCode = jrubyTruffle.execute(filename);
System.exit(exitCode);
}