Skip to content

Commit

Permalink
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -52,6 +52,12 @@ def self.find_graal
end
end

def self.find_graal_js
jar = ENV['GRAAL_JS_JAR']
return jar if jar
raise "couldn't find trufflejs.jar - download GraalVM as described in https://github.com/jruby/jruby/wiki/Downloading-GraalVM and find it in there"
end

def self.find_jruby
if USE_JRUBY_ECLIPSE
"#{JRUBY_DIR}/tool/jruby_eclipse"
@@ -206,6 +212,7 @@ def help
puts 'jt rebuild clean and build'
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 ' --js add Graal.js to the classpath (set GRAAL_JS_JAR)'
puts ' --asm show assembly (implies --graal)'
puts ' --server run an instrumentation server on port 8080'
puts ' --igv make sure IGV is running and dump Graal graphs after partial escape (implies --graal)'
@@ -247,10 +254,10 @@ def help
puts 'recognised environment variables:'
puts
puts ' RUBY_BIN The JRuby+Truffle executable to use (normally just bin/jruby)'
puts
puts ' GRAAL_BIN GraalVM executable (java command) to use'
puts ' GRAAL_BIN_...git_branch_name... GraalVM executable to use for a given branch'
puts ' branch names are mangled - eg truffle-head becomes GRAAL_BIN_TRUFFLE_HEAD'
puts ' GRAAL_JS_JAR The location of trufflejs.jar'
end

def checkout(branch)
@@ -297,6 +304,11 @@ def run(*args)
jruby_args << '-J-server'
end

if args.delete('--js')
jruby_args << '-J-classpath'
jruby_args << Utilities.find_graal_js
end

if args.delete('--asm')
jruby_args += %w[-J-XX:+UnlockDiagnosticVMOptions -J-XX:CompileCommand=print,*::callRoot]
end

0 comments on commit 0720fe7

Please sign in to comment.