Skip to content

Commit 61f773c

Browse files
committed
JT: Add needed --experimental-options
1 parent 8a229f4 commit 61f773c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

tool/jt.rb

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727

2828
JDEBUG_PORT = 51819
2929
JDEBUG = "--vm.agentlib:jdwp=transport=dt_socket,server=y,address=#{JDEBUG_PORT},suspend=y"
30-
JEXCEPTION = "--exceptions.print_uncaught_java=true"
3130
METRICS_REPS = Integer(ENV["TRUFFLERUBY_METRICS_REPS"] || 10)
3231
DEFAULT_PROFILE_OPTIONS = %w[--cpusampler --cpusampler.SampleInternal=true --cpusampler.Mode=roots --cpusampler.Output=json]
3332

@@ -517,7 +516,7 @@ def help
517516
cexts build only the C extensions (part of "jt build")
518517
graalvm [--graal] [--native] build a minimal JVM-only GraalVM containing only TruffleRuby
519518
--graal include graal compiler in the build
520-
--native build native ruby image as well
519+
--native build native ruby image as well
521520
native [--no-sulong] [--no-jvmci] [--no-sforceimports] [--no-tools] [extra mx image options]
522521
build a native image of TruffleRuby (--no-jvmci to use the system Java)
523522
(--no-tools to exclude chromeinspector and profiler)
@@ -582,8 +581,8 @@ def help
582581
jt metrics time ... how long does it take to run a command, broken down into different phases
583582
jt benchmark [options] args... run benchmark-interface (implies --graal)
584583
--no-graal don't imply --graal
585-
JT_BENCHMARK_RUBY=ruby benchmark some other Ruby, like MRI
586-
note that to run most MRI benchmarks, you should translate them first with normal
584+
JT_BENCHMARK_RUBY=ruby benchmark some other Ruby, like MRI
585+
note that to run most MRI benchmarks, you should translate them first with normal
587586
Ruby and cache the result, such as benchmark bench/mri/bm_vm1_not.rb --cache
588587
jt benchmark bench/mri/bm_vm1_not.rb --use-cache
589588
jt profile profiles an application, including the TruffleRuby runtime, and generates a flamegraph
@@ -724,9 +723,9 @@ def run_ruby(*args)
724723
when '--jdebug'
725724
vm_args << JDEBUG
726725
when '--jexception', '--jexceptions'
727-
vm_args << '--experimental-options' << JEXCEPTION
726+
vm_args << '--experimental-options' << '--exceptions.print_uncaught_java=true'
728727
when '--server'
729-
vm_args += %w[--instrumentation_server_port=8080]
728+
vm_args << '--experimental-options' << '--instrumentation_server_port=8080'
730729
when '--infopoints'
731730
vm_args << "--vm.XX:+UnlockDiagnosticVMOptions" << "--vm.XX:+DebugNonSafepoints"
732731
vm_args << "--vm.Dgraal.TruffleEnableInfopoints=true"
@@ -1038,7 +1037,7 @@ def retag(*args)
10381037
def test_compiler(*args)
10391038
env = {}
10401039

1041-
env['TRUFFLERUBYOPT'] = [*ENV['TRUFFLERUBYOPT'], '--exceptions.print_java=true'].join(' ')
1040+
env['TRUFFLERUBYOPT'] = [*ENV['TRUFFLERUBYOPT'], '--experimental-options', '--exceptions.print_java=true'].join(' ')
10421041

10431042
Dir["#{TRUFFLERUBY_DIR}/test/truffle/compiler/*.sh"].sort.each do |test_script|
10441043
if args.empty? or args.include?(File.basename(test_script, ".*"))
@@ -1245,12 +1244,17 @@ def test_bundle(*args)
12451244
# add bin from gem_home to PATH
12461245
'PATH' => ["#{gem_home}/bin", ENV['PATH']].join(File::PATH_SEPARATOR))
12471246

1247+
options = [
1248+
'--experimental-options',
1249+
'--exceptions.print_java=true',
1250+
]
1251+
12481252
gemserver_source = %w[--clear-sources --source http://localhost:8808]
12491253

1250-
run_ruby(environment, *args, '--exceptions.print_java=true',
1254+
run_ruby(environment, *args, *options,
12511255
'-Sbundle', 'install', '-V', *install_flags)
1252-
1253-
run_ruby(environment, *args, '--exceptions.print_java=true',
1256+
1257+
run_ruby(environment, *args, *options,
12541258
'-Sbundle', 'exec', '-V', 'rake')
12551259
end
12561260
ensure
@@ -1324,7 +1328,7 @@ def test_specs(command, *args)
13241328
end
13251329

13261330
if args.delete('--jexception') || args.delete('--jexceptions')
1327-
options << "-T#{JEXCEPTION}"
1331+
options << "-T--experimental-options" << "-T--exceptions.print_uncaught_java=true"
13281332
end
13291333

13301334
if args.delete('--truffle-formatter')
@@ -2351,7 +2355,7 @@ def dockerfile(*args)
23512355
end
23522356

23532357
configs.each do |config|
2354-
lines.push "RUN " + setup_env["ruby #{config} --vm.Dgraal.TruffleCompilationExceptionsAreThrown=true --vm.Dgraal.TruffleIterativePartialEscape=true --basic_ops.inline=false pe/pe.rb"]
2358+
lines.push "RUN " + setup_env["ruby #{config} --vm.Dgraal.TruffleCompilationExceptionsAreThrown=true --vm.Dgraal.TruffleIterativePartialEscape=true --experimental-options --basic_ops.inline=false pe/pe.rb"]
23552359
end
23562360
end
23572361

0 commit comments

Comments
 (0)