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

Commits on Sep 22, 2015

  1. Copy the full SHA
    4d08cd3 View commit details
  2. Copy the full SHA
    da934a0 View commit details
Showing with 28 additions and 12 deletions.
  1. +25 −9 bin/jruby.bash
  2. +3 −3 tool/jt.rb
34 changes: 25 additions & 9 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -200,13 +200,22 @@ JAVA_CLASS_NGSERVER=org.jruby.main.NailServerMain

# Split out any -J argument for passing to the JVM.
# Scanning for args is aborted by '--'.
set -- $JRUBY_OPTS "$@"

# Wrap $JRUBY_OPTS in "" to preserve options with spaces. However, wrapping in "" will ensure there's always a value.
# We only want to add $JRUBY_OPTS to $@ if it's non-empty, so check that first.
if [ "x$JRUBY_OPTS" != x ]; then
set -- "$JRUBY_OPTS" "$@"
fi

while [ $# -gt 0 ]
do
case "$1" in
# String leading and trailing whitespace from the option.
option="$(echo -e "$1" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"

case "$option" in
# Stuff after '-J' in this argument goes to JVM
-J*)
val=${1:2}
val=${option:2}
if [ "${val:0:4}" = "-Xmx" ]; then
JAVA_MEM=$val
elif [ "${val:0:4}" = "-Xms" ]; then
@@ -215,11 +224,11 @@ do
JAVA_STACK=$val
elif [ "${val}" = "" ]; then
$JAVACMD -help
echo "(Prepend -J in front of these options when using 'jruby' command)"
echo "(Prepend -J in front of these options when using 'jruby' command)"
exit
elif [ "${val}" = "-X" ]; then
$JAVACMD -X
echo "(Prepend -J in front of these options when using 'jruby' command)"
echo "(Prepend -J in front of these options when using 'jruby' command)"
exit
elif [ "${val}" = "-classpath" ]; then
CP="$CP$CP_DELIMITER$2"
@@ -235,15 +244,22 @@ do
elif [ "${val:0:16}" = "-Dfile.encoding=" ]; then
JAVA_ENCODING=$val
fi
java_args=("${java_args[@]}" "${1:2}")

# Check if the option has an embedded space and the option is not quoted (via a check of the last char in
# the option). NB: ": -1" is not a typo. If you delete that space character things will break.
if [[ "$option" =~ ' ' && (${option: -1} != "'" && ${option: -1} != '"') ]]; then
java_args=("${java_args[@]}" "'${option:2}'")
else
java_args=("${java_args[@]}" "${option:2}")
fi
fi
;;
# Pass -X... and -X? search options through
-X*\.\.\.|-X*\?)
ruby_args=("${ruby_args[@]}" "$1") ;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
val=${1:2}
val=${option:2}
if expr "$val" : '.*[.]' > /dev/null; then
java_args=("${java_args[@]}" "-Djruby.${val}")
else
@@ -271,7 +287,7 @@ do
else
JAVACMD="$JAVA_HOME/bin/jdb"
fi
fi
fi
java_args=("${java_args[@]}" "-sourcepath" "$JRUBY_HOME/lib/ruby/1.9:.")
JRUBY_OPTS=("${JRUBY_OPTS[@]}" "-X+C") ;;
--client)
@@ -396,7 +412,7 @@ else

exit $JRUBY_STATUS
else
exec "$JAVACMD" $JAVA_OPTS "$JFFI_OPTS" "${java_args[@]}" -Xbootclasspath/a:"$JRUBY_CP" -classpath "$CP$CP_DELIMITER$CLASSPATH" \
eval "$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" \
6 changes: 3 additions & 3 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -413,11 +413,11 @@ def bench(command, *args)
case command
when 'debug'
if args.delete '--ruby-backtrace'
compilation_exceptions_behaviour = ",+TruffleCompilationExceptionsAreThrown"
compilation_exceptions_behaviour = '+TruffleCompilationExceptionsAreThrown'
else
compilation_exceptions_behaviour = ",+TruffleCompilationExceptionsAreFatal"
compilation_exceptions_behaviour = '+TruffleCompilationExceptionsAreFatal'
end
env_vars = env_vars.merge({'JRUBY_OPTS' => "-J-Djvmci.options=+TraceTruffleCompilation,+DumpOnError,-GraphPE#{compilation_exceptions_behaviour}"})
env_vars = env_vars.merge({'JRUBY_OPTS' => "-J-Djvmci.options='+TraceTruffleCompilation #{compilation_exceptions_behaviour}'"})
bench_args += ['score', 'jruby-9000-dev-truffle-graal', '--show-commands', '--show-samples']
raise 'specify a single benchmark for run - eg classic-fannkuch-redux' if args.size != 1
when 'reference'