From 3c182776292ecd2a28fea4f7de87a89e64459f9c Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 21 Dec 2023 16:18:30 -0800 Subject: [PATCH] RJIT: Clean up unnecessary documentation --- doc/.document | 1 + doc/rjit/{README.md => rjit.md} | 12 ++---------- lib/ruby_vm/rjit/.document | 1 + lib/ruby_vm/rjit/stats.rb | 2 ++ rjit.rb | 4 ++-- 5 files changed, 8 insertions(+), 12 deletions(-) rename doc/rjit/{README.md => rjit.md} (75%) create mode 100644 lib/ruby_vm/rjit/.document diff --git a/doc/.document b/doc/.document index 061fa7d3ef..5a58e6e3ad 100644 --- a/doc/.document +++ b/doc/.document @@ -7,4 +7,5 @@ syntax optparse rdoc regexp +rjit yjit diff --git a/doc/rjit/README.md b/doc/rjit/rjit.md similarity index 75% rename from doc/rjit/README.md rename to doc/rjit/rjit.md index e3795e35b8..9e60e43ce3 100644 --- a/doc/rjit/README.md +++ b/doc/rjit/rjit.md @@ -24,13 +24,6 @@ You may still manually pass `--enable-rjit` to try RJIT on unsupported platforms It enables `--rjit-dump-disasm` if libcapstone is available. -It also enables `vm_insns_count` and `ratio_in_rjit` in `--rjit-stats`. -However, it makes the interpreter a little slower. - -### --enable-rjit=disasm - -It enables `--rjit-dump-disasm` if libcapstone is available. - ## make ### rjit-bindgen @@ -42,12 +35,11 @@ macOS seems to have libclang by default. On Ubuntu, you can install it with `apt ## ruby ### --rjit-stats -This prints RJIT stats at exit. Some stats are available only with `--enable-rjit=dev` on configure. +This prints RJIT stats at exit. ### --rjit-dump-disasm -This dumps all JIT code. You need to install libcapstone before configure and use `--enable-rjit=dev` -or `--enable-rjit=disasm` on configure. +This dumps all JIT code. You need to install libcapstone before configure and use `--enable-rjit=dev` on configure. * Ubuntu: `sudo apt-get install -y libcapstone-dev` * macOS: `brew install capstone` diff --git a/lib/ruby_vm/rjit/.document b/lib/ruby_vm/rjit/.document new file mode 100644 index 0000000000..0a603afe3d --- /dev/null +++ b/lib/ruby_vm/rjit/.document @@ -0,0 +1 @@ +stats.rb diff --git a/lib/ruby_vm/rjit/stats.rb b/lib/ruby_vm/rjit/stats.rb index 484ddb3a1d..7e353c698e 100644 --- a/lib/ruby_vm/rjit/stats.rb +++ b/lib/ruby_vm/rjit/stats.rb @@ -1,5 +1,6 @@ # frozen_string_literal: true module RubyVM::RJIT + # Return a Hash for \RJIT statistics. \--rjit-stats makes more information available. def self.runtime_stats stats = {} @@ -30,6 +31,7 @@ module RubyVM::RJIT stats end + # :nodoc: all class << self private diff --git a/rjit.rb b/rjit.rb index 60d76c3f43..12fc10c91e 100644 --- a/rjit.rb +++ b/rjit.rb @@ -1,10 +1,10 @@ module RubyVM::RJIT - # Return true if RJIT is enabled. + # Return true if \RJIT is enabled. def self.enabled? Primitive.cexpr! 'RBOOL(rb_rjit_enabled)' end - # Start generating JITed code again after --rjit-disable. + # Start JIT compilation after \--rjit-disable. def self.enable Primitive.cstmt! %{ rb_rjit_call_p = true;