summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mjit.c b/mjit.c
index 502769c52b..b8cb4f5424 100644
--- a/mjit.c
+++ b/mjit.c
@@ -1314,12 +1314,16 @@ system_tmpdir(void)
/* Minimum value for JIT cache size. */
#define MIN_CACHE_SIZE 10
+extern const char ruby_description_with_jit[];
+
/* Initialize MJIT. Start a thread creating the precompiled header and
processing ISeqs. The function should be called first for using MJIT.
If everything is successfull, MJIT_INIT_P will be TRUE. */
void
mjit_init(struct mjit_options *opts)
{
+ VALUE rb_description;
+
mjit_opts = *opts;
mjit_init_p = TRUE;
@@ -1366,6 +1370,11 @@ mjit_init(struct mjit_options *opts)
rb_id_table_foreach(RCLASS_CONST_TBL(rb_cObject), valid_class_serials_add_i, NULL);
}
+ /* Overwrites RUBY_DESCRIPTION constant */
+ rb_const_remove(rb_cObject, rb_intern("RUBY_DESCRIPTION"));
+ rb_description = rb_usascii_str_new_static(ruby_description_with_jit, strlen(ruby_description_with_jit));
+ rb_define_global_const("RUBY_DESCRIPTION", rb_obj_freeze(rb_description));
+
/* Initialize worker thread */
finish_worker_p = FALSE;
worker_finished = FALSE;