Skip to content

Commit 02dbf93

Browse files
committed
jt: add #truffleruby_jvm? for readability
1 parent 67e5f6a commit 02dbf93

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

tool/jt.rb

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,10 @@ def truffleruby?
278278
@truffleruby ||= File.executable?(truffleruby_launcher_path)
279279
end
280280

281+
def truffleruby_jvm?
282+
truffleruby? and !truffleruby_native?
283+
end
284+
281285
def truffleruby_launcher_path
282286
require_ruby_launcher!
283287
@truffleruby_launcher_path ||= File.expand_path('../truffleruby', @ruby_launcher_realpath)
@@ -869,7 +873,7 @@ def rebuild(*options)
869873
when '--no-core-load-path'
870874
core_load_path = false
871875
when '--reveal'
872-
vm_args += %w[--vm.ea --vm.esa] unless truffleruby_native?
876+
vm_args += %w[--vm.ea --vm.esa] if truffleruby_jvm?
873877
when '--check-compilation'
874878
add_experimental_options.call
875879
vm_args << '--engine.CompilationFailureAction=ExitVM'
@@ -889,7 +893,7 @@ def rebuild(*options)
889893
add_experimental_options.call
890894
vm_args << '--exceptions-print-uncaught-java=true'
891895
when '--infopoints'
892-
unless truffleruby_native?
896+
if truffleruby_jvm?
893897
vm_args << '--vm.XX:+UnlockDiagnosticVMOptions' << '--vm.XX:+DebugNonSafepoints'
894898
end
895899
vm_args << '--engine.NodeSourcePositions=true'
@@ -915,14 +919,13 @@ def rebuild(*options)
915919
end
916920
end
917921

918-
if truffleruby? && !truffleruby_native?
919-
if core_load_path
920-
add_experimental_options.call
921-
vm_args << "--core-load-path=#{TRUFFLERUBY_DIR}/src/main/ruby/truffleruby"
922-
end
923-
if ci?
924-
vm_args << '--vm.Xlog:os+thread=off' # GR-23507: prevent thread warnings on stdout to break specs/tests
925-
end
922+
if core_load_path and truffleruby_jvm?
923+
add_experimental_options.call
924+
vm_args << "--core-load-path=#{TRUFFLERUBY_DIR}/src/main/ruby/truffleruby"
925+
end
926+
927+
if ci? and truffleruby_jvm?
928+
vm_args << '--vm.Xlog:os+thread=off' # GR-23507: prevent thread warnings on stdout to break specs/tests
926929
end
927930

928931
[vm_args, ruby_args + args, options]
@@ -1514,7 +1517,7 @@ def mspec(*args)
15141517

15151518
vm_args, ruby_args, parsed_options = ruby_options({}, ['--reveal', *ruby_args])
15161519
vm_args << (truffleruby_native? ? '--vm.Xmx3G' : '--vm.Xmx2G')
1517-
vm_args << '--polyglot' unless truffleruby_native?
1520+
vm_args << '--polyglot' if truffleruby_jvm?
15181521
# Until pattern matching is complete, we enable it in specs but not globally
15191522
vm_args << '--experimental-options' << '--pattern-matching'
15201523

0 commit comments

Comments
 (0)