[前][次][番号順一覧][スレッド一覧]

ruby-changes:69177

From: Noah <ko1@a...>
Date: Thu, 21 Oct 2021 08:19:11 +0900 (JST)
Subject: [ruby-changes:69177] d1d3d2c0aa (master): If --yjit-stats is given without RUBY_DEBUG, that should be an error.

https://git.ruby-lang.org/ruby.git/commit/?id=d1d3d2c0aa

From d1d3d2c0aab39511258c5c75b34396601a94f6f5 Mon Sep 17 00:00:00 2001
From: Noah Gibbs <noah.gibbs@s...>
Date: Mon, 14 Jun 2021 12:07:27 +0100
Subject: If --yjit-stats is given without RUBY_DEBUG, that should be an error.

---
 yjit_iface.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/yjit_iface.c b/yjit_iface.c
index 36f0819d7d..6ed1587560 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -1025,6 +1025,7 @@ rb_yjit_call_threshold(void) https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L1025
     return rb_yjit_opts.call_threshold;
 }
 
+// Can raise RuntimeError
 void
 rb_yjit_init(struct rb_yjit_options *options)
 {
@@ -1037,6 +1038,12 @@ rb_yjit_init(struct rb_yjit_options *options) https://github.com/ruby/ruby/blob/trunk/yjit_iface.c#L1038
 
     rb_yjit_opts.gen_stats |= !!getenv("YJIT_STATS");
 
+#if !RUBY_DEBUG
+    if(rb_yjit_opts.gen_stats) {
+        rb_raise(rb_eRuntimeError, "--yjit-stats requires that Ruby is compiled with CPPFLAGS='-DRUBY_DEBUG=1'");
+    }
+#endif
+
     // Normalize command-line options to default values
     if (rb_yjit_opts.exec_mem_size < 1) {
         rb_yjit_opts.exec_mem_size = 256;
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]