summaryrefslogtreecommitdiff
path: root/yjit/src
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-02-03 21:37:33 -0800
committerGitHub <noreply@github.com>2024-02-04 05:37:33 +0000
commita065b68bd8d93505304f90bbb1855c864e17ad61 (patch)
tree338f5c7e230d55ef598a43ccb887496b164b2227 /yjit/src
parentba16b340981942eda82d6328800b8098c452c0ca (diff)
Backport #9415 to ruby_3_3 (#9424)
YJIT: Let RubyVM::YJIT.enable respect --yjit-stats
Diffstat (limited to 'yjit/src')
-rw-r--r--yjit/src/yjit.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/yjit/src/yjit.rs b/yjit/src/yjit.rs
index cd51ed048b..50335a7987 100644
--- a/yjit/src/yjit.rs
+++ b/yjit/src/yjit.rs
@@ -171,9 +171,11 @@ pub extern "C" fn rb_yjit_code_gc(_ec: EcPtr, _ruby_self: VALUE) -> VALUE {
pub extern "C" fn rb_yjit_enable(_ec: EcPtr, _ruby_self: VALUE, gen_stats: VALUE, print_stats: VALUE) -> VALUE {
with_vm_lock(src_loc!(), || {
// Initialize and enable YJIT
- unsafe {
- OPTIONS.gen_stats = gen_stats.test();
- OPTIONS.print_stats = print_stats.test();
+ if gen_stats.test() {
+ unsafe {
+ OPTIONS.gen_stats = gen_stats.test();
+ OPTIONS.print_stats = print_stats.test();
+ }
}
yjit_init();