@@ -61,6 +61,16 @@ const int ruby_api_version[] = {
61
61
#else
62
62
#define YJIT_DESCRIPTION " +YJIT"
63
63
#endif
64
+ #ifdef ZJIT_SUPPORT
65
+ #define ZJIT_DESCRIPTION " +ZJIT " STRINGIZE(ZJIT_SUPPORT)
66
+ #else
67
+ #define ZJIT_DESCRIPTION " +ZJIT"
68
+ #endif
69
+ #if USE_ZJIT
70
+ #define JIT_DESCRIPTION ZJIT_DESCRIPTION
71
+ #else
72
+ #define JIT_DESCRIPTION YJIT_DESCRIPTION
73
+ #endif
64
74
#if USE_MODULAR_GC
65
75
#define GC_DESCRIPTION " +GC"
66
76
#else
@@ -162,6 +172,12 @@ Init_version(void)
162
172
#define YJIT_OPTS_ON 0
163
173
#endif
164
174
175
+ #if USE_ZJIT
176
+ #define ZJIT_OPTS_ON opt->zjit
177
+ #else
178
+ #define ZJIT_OPTS_ON 0
179
+ #endif
180
+
165
181
int ruby_mn_threads_enabled ;
166
182
167
183
#ifndef RB_DEFAULT_PARSER
@@ -186,7 +202,7 @@ define_ruby_description(const char *const jit_opt)
186
202
{
187
203
static char desc [
188
204
sizeof (ruby_description )
189
- + rb_strlen_lit (YJIT_DESCRIPTION )
205
+ + rb_strlen_lit (JIT_DESCRIPTION )
190
206
+ rb_strlen_lit (" +MN" )
191
207
+ rb_strlen_lit (" +PRISM" )
192
208
#if USE_MODULAR_GC
@@ -203,7 +219,7 @@ define_ruby_description(const char *const jit_opt)
203
219
memcpy (desc , ruby_description , n );
204
220
# define append (s ) (n += (int)strlcpy(desc + n, s, sizeof(desc) - n))
205
221
if (* jit_opt ) append (jit_opt );
206
- RUBY_ASSERT (n <= ruby_description_opt_point + (int )rb_strlen_lit (YJIT_DESCRIPTION ));
222
+ RUBY_ASSERT (n <= ruby_description_opt_point + (int )rb_strlen_lit (JIT_DESCRIPTION ));
207
223
if (ruby_mn_threads_enabled ) append (" +MN" );
208
224
if (rb_ruby_prism_p ()) append (" +PRISM" );
209
225
#if USE_MODULAR_GC
@@ -232,6 +248,7 @@ Init_ruby_description(ruby_cmdline_options_t *opt)
232
248
{
233
249
const char * const jit_opt =
234
250
YJIT_OPTS_ON ? YJIT_DESCRIPTION :
251
+ ZJIT_OPTS_ON ? ZJIT_DESCRIPTION :
235
252
"" ;
236
253
define_ruby_description (jit_opt );
237
254
}
0 commit comments