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

Commits on Jan 24, 2015

  1. [Truffle] jt run --graal

    chrisseaton committed Jan 24, 2015
    Copy the full SHA
    f0f5173 View commit details
  2. Copy the full SHA
    940aefc View commit details
Showing with 42 additions and 4 deletions.
  1. +42 −4 tool/jt.rb
46 changes: 42 additions & 4 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -10,12 +10,32 @@

# Recommended: function jt { ruby tool/jt.rb $@; }

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
]

def self.find_graal
GRAAL_LOCATIONS.each do |location|
if !location.nil? && File.executable?(location)
return location
end
end
# TODO(CS 24-Jan-15) download it?
raise "coudln't find graal"
end

end

module ShellUtils
private

def sh(*args)
system(*args)
raise "failed" unless $? == 0
raise 'failed' unless $? == 0
end

def mvn(*args)
@@ -34,7 +54,9 @@ def help
puts 'jt build build'
puts 'jt clean clean'
puts 'jt rebuild clean and build'
puts 'jt run args... run JRuby with -X+T and args'
puts 'jt run [options] args... run JRuby with -X+T and args'
puts ' --graal use Graal (set GRAAL_BIN or it will try to automagically find it)'
puts ' --asm show assembly (use with --graal)'
puts 'jt test run all specs'
puts 'jt test fast run all specs except sub-processes, GC, sleep, ...'
puts 'jt test spec/ruby/language run specs in this directory'
@@ -63,7 +85,23 @@ def rebuild
end

def run(*args)
sh({ "VERIFY_JRUBY" => "1" }, *%w[bin/jruby -J-cp truffle/target/jruby-truffle-9.0.0.0-SNAPSHOT.jar -X+T], *args)
env_vars = {}
jruby_args = []

while %w[--graal --asm].include? args.first
case args.shift
when '--graal'
env_vars["JAVACMD"] = Utilities.find_graal
jruby_args << '-J-server'
when '--asm'
jruby_args += %w[-J-XX:+UnlockDiagnosticVMOptions -J-XX:CompileCommand=print,*::callRoot]
end
end

env_vars['VERIFY_JRUBY'] = '1'
jruby_args += args

sh(env_vars, *%w[bin/jruby -J-cp truffle/target/jruby-truffle-9.0.0.0-SNAPSHOT.jar -X+T], *jruby_args)
end

def test(*args)
@@ -89,7 +127,7 @@ def untag(path, *args)

def findbugs(report=nil)
case report
when "report"
when 'report'
sh 'tool/truffle-findbugs.sh', '--report' rescue nil
sh 'open', 'truffle-findbugs-report.html' rescue nil
when nil