Skip to content

Commit 22c8fb3

Browse files
committed
Rename TruffleRuby.graal? to TruffleRuby.jit?.
1 parent ecc4682 commit 22c8fb3

File tree

12 files changed

+17
-12
lines changed

12 files changed

+17
-12
lines changed

doc/samples/can-we-fold-yet.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
require 'readline'
1212

13-
unless TruffleRuby.graal?
13+
unless TruffleRuby.jit?
1414
puts 'You need the GraalVM Compiler to run this'
1515
exit
1616
end

doc/user/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ chris.seaton@oracle.com.
8989

9090
`ruby --version` will report `GraalVM CE` or `EE`.
9191

92-
`TruffleRuby.graal?` will tell you if you are also running with the GraalVM
92+
`TruffleRuby.jit?` will tell you if you are also running with the GraalVM
9393
Compiler.
9494

9595
### How do I know that I'm using the Community Edition of GraalVM?

doc/user/truffleruby-additions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ standard `RUBY_ENGINE_VERSION` constant.
3535
TruffleRuby provides these non-standard methods and classes that provide
3636
additional functionality in the `TruffleRuby` module.
3737

38-
`TruffleRuby.graal?` reports if the GraalVM Compiler is available and will be
38+
`TruffleRuby.jit?` reports if the GraalVM Compiler is available and will be
3939
used.
4040

4141
`TruffleRuby.native?` reports if TruffleRuby is compiled as a native image.

spec/truffle/graal/assert_constant_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
-> { Truffle::Graal.send(:assert_constant, 14 + 2) }.should raise_error(RuntimeError)
1515
end
1616

17-
unless TruffleRuby.graal?
17+
unless TruffleRuby.jit?
1818
it "returns the value of the argument" do
1919
Truffle::Graal.assert_constant(14 + 2).should == 16
2020
end

spec/truffle/graal/assert_not_compiled_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
-> { Truffle::Graal.send(:assert_not_compiled) }.should raise_error(RuntimeError)
1515
end
1616

17-
unless TruffleRuby.graal?
17+
unless TruffleRuby.jit?
1818
it "returns nil" do
1919
Truffle::Graal.assert_not_compiled.should be_nil
2020
end

spec/truffle/launcher_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def should_print_full_java_command(options, env: {})
298298
out.should_not include('RubyLauncher.main')
299299
end
300300

301-
guard -> { TruffleRuby.graal? } do
301+
guard -> { TruffleRuby.jit? } do
302302
it "applies Truffle options" do
303303
options = [
304304
"--vm.Dgraal.TraceTruffleCompilation=true",

spec/truffle/truffleruby/graal_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
require_relative '../../ruby/spec_helper'
1010

11-
describe "TruffleRuby.graal?" do
11+
describe "TruffleRuby.jit?" do
1212

1313
it "returns a Boolean value" do
14-
TruffleRuby.graal?.should be_true_or_false
14+
TruffleRuby.jit?.should be_true_or_false
1515
end
1616

1717
end

spec/truffle/truffleruby/no_other_methods_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
it "contains no other public methods" do
1414
(TruffleRuby.methods - Module.new.methods).sort.should == %i{
15-
full_memory_barrier graal? native? revision sulong? cexts? synchronized
15+
full_memory_barrier graal? jit? native? revision sulong? cexts? synchronized
1616
}.sort
1717
end
1818

src/main/java/org/truffleruby/extra/TruffleRubyNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@CoreClass("TruffleRuby")
3030
public abstract class TruffleRubyNodes {
3131

32-
@CoreMethod(names = "graal?", onSingleton = true)
32+
@CoreMethod(names = "jit?", onSingleton = true)
3333
public abstract static class GraalNode extends CoreMethodArrayArgumentsNode {
3434

3535
@TruffleBoundary

src/main/ruby/core/truffle/backward.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,9 @@ def self.sulong?
3838
cexts?
3939
end
4040

41+
def self.graal?
42+
warn 'TruffleRuby.graal? has been replaced by TruffleRuby.jit? and will be removed at a future release', uplevel: 1
43+
jit?
44+
end
45+
4146
end

0 commit comments

Comments
 (0)