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

Commits on Feb 18, 2015

  1. Copy the full SHA
    9f6a1d9 View commit details
  2. Copy the full SHA
    8cd0203 View commit details
Showing with 13 additions and 5 deletions.
  1. +13 −5 tool/jt.rb
18 changes: 13 additions & 5 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -20,18 +20,20 @@ module Utilities

GRAAL_LOCATIONS = [
ENV['GRAAL_BIN'],
'../graalvm-jdk1.8.0/bin/java', # This also seems like a sensible place to keep it
'../../graal/graalvm-jdk1.8.0/bin/java' # This is where I (CS) keep it
'graalvm-jdk1.8.0/bin/java',
'../graalvm-jdk1.8.0/bin/java',
'../../graal/graalvm-jdk1.8.0/bin/java'
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }

BENCH_LOCATIONS = [
ENV['BENCH_DIR'],
'bench9000',
'../bench9000'
].compact.map { |path| File.expand_path(path, JRUBY_DIR) }

def self.find_graal
not_found = -> {
raise "couldn't find graal - download it from http://lafo.ssw.uni-linz.ac.at/graalvm/ and extract it into the parent directory"
raise "couldn't find graal - download it from http://lafo.ssw.uni-linz.ac.at/graalvm/ and extract it into the JRuby repository or parent directory"
}
GRAAL_LOCATIONS.find(not_found) do |location|
File.executable?(location)
@@ -40,7 +42,7 @@ def self.find_graal

def self.find_bench
not_found = -> {
raise "couldn't find bench9000 - clone it from https://github.com/jruby/bench9000.git into the parent directory"
raise "couldn't find bench9000 - clone it from https://github.com/jruby/bench9000.git into the JRuby repository or parent directory"
}
BENCH_LOCATIONS.find(not_found) do |location|
Dir.exist?(location)
@@ -104,6 +106,7 @@ def help
puts 'jt tag spec/ruby/language/while_spec.rb tag failing specs in this file'
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 bench debug benchmark run a single benchmark with options for compiler debugging'
puts 'jt bench reference [benchmarks] run a set of benchmarks and record a reference point'
puts 'jt bench compare [benchmarks] run a set of benchmarks and compare against a reference point'
puts ' benchmarks can be any benchmarks of group of benchmarks supported'
@@ -200,13 +203,18 @@ def bench(command, *args)
"JRUBY_9000_DEV_DIR" => JRUBY_DIR,
"GRAAL_BIN" => Utilities.find_graal,
}
args << "5" if args.empty?
bench_args = ["-I#{bench_dir}/lib", "#{bench_dir}/bin/bench"]
case command
when 'debug'
env_vars = env_vars.merge({'JRUBY_OPTS' => '-J-G:+TraceTruffleCompilation'})
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'
bench_args += ['reference', 'jruby-9000-dev-truffle-graal', '--show-commands']
args << "5" if args.empty?
when 'compare'
bench_args += ['compare-reference', 'jruby-9000-dev-truffle-graal']
args << "5" if args.empty?
else
raise ArgumentError, command
end