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

Commits on Jun 22, 2016

  1. Copy the full SHA
    c68c0b4 View commit details
  2. Rename -X-T to be -Xclassic

    * -X-T still looks like it could enable Truffle
    * also make -Xclassic not apply reconfiguration in the first place, rather than reverse it flakily
    chrisseaton committed Jun 22, 2016
    Copy the full SHA
    47120e1 View commit details
Showing with 26 additions and 14 deletions.
  1. +13 −2 bin/jruby.bash
  2. +4 −2 bin/jruby.sh
  3. +4 −4 ci.hocon
  4. +2 −4 core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
  5. +1 −0 core/src/main/java/org/jruby/util/cli/OutputStrings.java
  6. +2 −2 tool/jt.rb
15 changes: 13 additions & 2 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -243,9 +243,10 @@ do
# Pass -X... and -X? search options through
-X*\.\.\.|-X*\?)
ruby_args=("${ruby_args[@]}" "$1") ;;
-Xclassic)
unset USING_TRUFFLE
;;
-X+T)
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args=("${ruby_args[@]}" "-X+T")
USING_TRUFFLE="true"
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
@@ -315,6 +316,11 @@ do
shift
done

if [[ "$USING_TRUFFLE" != "" ]]; then
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args=("${ruby_args[@]}" "-X+T")
fi

# Force file.encoding to UTF-8 when on Mac, since Apple JDK defaults to MacRoman (JRUBY-3576)
if [[ $darwin && -z "$JAVA_ENCODING" ]]; then
java_args=("${java_args[@]}" "-Dfile.encoding=UTF-8")
@@ -403,6 +409,11 @@ else

exit $JRUBY_STATUS
else
echo exec "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
"-Djruby.home=$JRUBY_HOME" \
"-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
"-Djruby.shell=$JRUBY_SHELL" \
$java_class $mode "$@"
exec "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
"-Djruby.home=$JRUBY_HOME" \
"-Djruby.lib=$JRUBY_HOME/lib" -Djruby.script=jruby \
6 changes: 4 additions & 2 deletions bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -197,8 +197,10 @@ do
-X*\.\.\.|-X*\?)
ruby_args="${ruby_args} $1" ;;
-X+T)
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args="${ruby_args} -X+T"
echo "error: -X+T 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
-X*)
8 changes: 4 additions & 4 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ jruby-noindy-metrics: {
environment: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: noindy,
JRUBY_OPTS: "-X-T -Xcompile.invokedynamic=false",
JRUBY_OPTS: "-Xclassic -Xcompile.invokedynamic=false",
MX_BENCHMARK_OPTS: --no-graal
}
}
@@ -83,7 +83,7 @@ jruby-noindy-benchmark: {
environment: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: noindy,
JRUBY_OPTS: "-X-T -X+C -Xcompile.invokedynamic=false",
JRUBY_OPTS: "-Xclassic -X+C -Xcompile.invokedynamic=false",
MX_BENCHMARK_OPTS: --no-graal
}
}
@@ -92,7 +92,7 @@ jruby-indy-metrics: {
environment: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: indy,
JRUBY_OPTS: "-X-T -Xcompile.invokedynamic=true",
JRUBY_OPTS: "-Xclassic -Xcompile.invokedynamic=true",
MX_BENCHMARK_OPTS: --no-graal
}
}
@@ -101,7 +101,7 @@ jruby-indy-benchmark: {
environment: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: indy,
JRUBY_OPTS: "-X-T -X+C -Xcompile.invokedynamic=true",
JRUBY_OPTS: "-Xclassic -X+C -Xcompile.invokedynamic=true",
MX_BENCHMARK_OPTS: --no-graal
}
}
6 changes: 2 additions & 4 deletions core/src/main/java/org/jruby/util/cli/ArgumentProcessor.java
Original file line number Diff line number Diff line change
@@ -388,10 +388,8 @@ private void processArgument() {
config.setCompileMode(RubyInstanceConfig.CompileMode.OFF);
} else if (extendedOption.equals("+C") || extendedOption.equals("+CIR")) {
config.setCompileMode(RubyInstanceConfig.CompileMode.FORCE);
} else if (extendedOption.equals("-T")) {
config.setCompileMode(RubyInstanceConfig.CompileMode.OFF);
Options.COMPILE_MODE.unforce();
config.setDisableGems(false);
} 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")) {
Options.PARSER_WARN_GROUPED_EXPRESSIONS.force(Boolean.FALSE.toString());
config.setCompileMode(RubyInstanceConfig.CompileMode.TRUFFLE);
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/OutputStrings.java
Original file line number Diff line number Diff line change
@@ -88,6 +88,7 @@ public static String getExtendedHelp() {
.append(" -X+CIR force compilation and use IR runtime\n")
.append(" -X+JIR JIT compilation and use IR runtime\n")
.append(" -X+T use Truffle\n")
.append(" -Xclassic don't use Truffle, reversing the -X+T option\n")
.append(" -Xsubstring? list options that contain substring in their name\n")
.append(" -Xprefix... list options that are prefixed wtih prefix\n");

4 changes: 2 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -373,7 +373,7 @@ def help
puts 'jt tag all spec/ruby/language tag all specs in this file, without running them'
puts 'jt untag spec/ruby/language untag passing specs in this directory'
puts 'jt untag spec/ruby/language/while_spec.rb untag passing specs in this file'
puts 'jt metrics alloc [--json] ... how much memory is allocated running a program (use -X-T to test normal JRuby on this metric and others)'
puts 'jt metrics alloc [--json] ... how much memory is allocated running a program (use -Xclassic to test normal JRuby on this metric and others)'
puts 'jt metrics minheap ... what is the smallest heap you can use to run an application'
puts 'jt metrics time ... how long does it take to run a command, broken down into different phases'
puts 'jt tarball build the and test the distribution tarball'
@@ -448,7 +448,7 @@ def run(*args)
'-Xtruffle.graal.warn_unless=false'
]

if ENV['JRUBY_OPTS'] && ENV['JRUBY_OPTS'].include?('-X-T')
if ENV['JRUBY_OPTS'] && ENV['JRUBY_OPTS'].include?('-Xclassic')
jruby_args.delete '-X+T'
end