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

Commits on Oct 2, 2015

  1. Copy the full SHA
    df42696 View commit details
  2. Copy the full SHA
    244093c View commit details
  3. Copy the full SHA
    74a54af View commit details
Showing with 19 additions and 17 deletions.
  1. +6 −6 test/truffle/pe/core/binding_pe.rb
  2. +1 −1 test/truffle/pe/pe.rb
  3. +12 −10 tool/jt.rb
12 changes: 6 additions & 6 deletions test/truffle/pe/core/binding_pe.rb
Original file line number Diff line number Diff line change
@@ -10,24 +10,24 @@

# Kernel#binding
tagged_example "x = 14; binding.local_variable_get(:x)", 14
example "x = 14; binding.local_variable_get(:x) * 2", 28
tagged_example "x = 14; binding.local_variable_get(:x) * 2", 28

# Proc#binding
tagged_example "x = 14; p = Proc.new { }; p.binding.local_variable_get(:x)", 14
example "x = 14; p = Proc.new { }; p.binding.local_variable_get(:x) * 2", 28
tagged_example "x = 14; p = Proc.new { }; p.binding.local_variable_get(:x) * 2", 28

# set + get
tagged_example "b = binding; b.local_variable_set(:x, 14); b.local_variable_get(:x)", 14
example "b = binding; b.local_variable_set(:x, 14); b.local_variable_get(:x) * 2", 28
tagged_example "b = binding; b.local_variable_set(:x, 14); b.local_variable_get(:x) * 2", 28

# get (2 levels)
tagged_example "x = 14; y = nil; 1.times { y = binding.local_variable_get(:x) }; y", 14
example "x = 14; y = nil; 1.times { y = binding.local_variable_get(:x) }; y * 2", 28
tagged_example "x = 14; y = nil; 1.times { y = binding.local_variable_get(:x) }; y * 2", 28

# set (2 levels)
tagged_example "x = 14; 1.times { binding.local_variable_set(:x, 15) }; x", 15
example "x = 14; 1.times { binding.local_variable_set(:x, 15) }; x * 2", 30
tagged_example "x = 14; 1.times { binding.local_variable_set(:x, 15) }; x * 2", 30

# get + set (2 levels)
tagged_example "x = 14; y = nil; 1.times { binding.local_variable_set(:x, 15); y = binding.local_variable_get(:x) }; y", 15
example "x = 14; y = nil; 1.times { binding.local_variable_set(:x, 15); y = binding.local_variable_get(:x) }; y * 2", 30
tagged_example "x = 14; y = nil; 1.times { binding.local_variable_set(:x, 15); y = binding.local_variable_get(:x) }; y * 2", 30
2 changes: 1 addition & 1 deletion test/truffle/pe/pe.rb
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@
#
# Run with:
#
# jt run --graal "-J-Djvmci.options=+TraceTruffleCompilation +TruffleCompilationExceptionsAreFatal" test.rb
# jt run --graal -J-Djvmci.option.TraceTruffleCompilation=true -J-Djvmci.option.TruffleCompilationExceptionsAreFatal=true test.rb

TIMEOUT = 10

22 changes: 12 additions & 10 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -60,24 +60,26 @@ def self.mangle_for_env(name)
end

def self.find_graal_parent
File.expand_path('../../../../../graal', find_graal)
graal = File.expand_path('../../../../../graal-compiler', find_graal)
raise "couldn't find graal - set GRAAL_BIN, and you need to use a checkout of Graal, not a build" unless Dir.exist?(graal)
graal
end

def self.find_graal_mx
mx = File.expand_path('../../../../../mx/mx', find_graal)
mx = File.expand_path('../../../../../../mx/mx', find_graal)
raise "couldn't find mx - set GRAAL_BIN, and you need to use a checkout of Graal, not a build" unless File.executable?(mx)
mx
end

def self.igv_running?
`ps a`.lines.any? { |p| p.include? 'mx/mx.py igv' }
`ps a`.include? 'IdealGraphVisualizer'
end

def self.ensure_igv_running
unless igv_running?
#Dir.chdir(find_graal_parent) do
# spawn "#{find_graal_mx} igv", pgroup: true
#end
Dir.chdir(find_graal_parent + "/../jvmci") do
spawn "#{find_graal_mx} --vm server igv", pgroup: true
end

sleep 5
puts
@@ -280,7 +282,7 @@ def run(*args)
if args.delete('--igv')
warn "warning: --igv might not work on master - if it does not, use truffle-head instead which builds against latest graal" if Utilities.git_branch == 'master'
Utilities.ensure_igv_running
jruby_args += %w[-J-Djvmci.options=Dump=TrufflePartialEscape]
jruby_args += %w[-J-Djvmci.option.Dump=TrufflePartialEscape]
end

if ENV["JRUBY_ECLIPSE"] == "true"
@@ -414,11 +416,11 @@ def bench(command, *args)
case command
when 'debug'
if args.delete '--ruby-backtrace'
compilation_exceptions_behaviour = '+TruffleCompilationExceptionsAreThrown'
compilation_exceptions_behaviour = '-J-Djvmci.option.TruffleCompilationExceptionsAreThrown=true'
else
compilation_exceptions_behaviour = '+TruffleCompilationExceptionsAreFatal'
compilation_exceptions_behaviour = '-J-Djvmci.option.TruffleCompilationExceptionsAreFatal=true'
end
env_vars = env_vars.merge({'JRUBY_OPTS' => "-J-Djvmci.options='+TraceTruffleCompilation #{compilation_exceptions_behaviour}'"})
env_vars = env_vars.merge({'JRUBY_OPTS' => "-J-Djvmci.option.TraceTruffleCompilation=true #{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'