summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2021-01-13 22:36:45 -0800
committerTakashi Kokubun <takashikkbn@gmail.com>2021-01-13 22:46:51 -0800
commite1fee7f949cb6719122672fa1081c60984a5339f (patch)
tree3a851fdfcdbf395f5783aecaacf521308ddfd74e /vm.c
parent4d13f3e9da6298a1f8154def2e341ecb7c5fe116 (diff)
Rename RubyVM::MJIT to RubyVM::JIT
because the name "MJIT" is an internal code name, it's inconsistent with --jit while they are related to each other, and I want to discourage future JIT implementation-specific (e.g. MJIT-specific) APIs by this rename. [Feature #17490]
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/vm.c b/vm.c
index faea688..5beb6d0 100644
--- a/vm.c
+++ b/vm.c
@@ -3198,13 +3198,13 @@ core_hash_merge_kwd(VALUE hash, VALUE kw)
/* Returns true if JIT is enabled */
static VALUE
-mjit_enabled_p(VALUE _)
+jit_enabled_p(VALUE _)
{
return mjit_enabled ? Qtrue : Qfalse;
}
static VALUE
-mjit_pause_m(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
+jit_pause_m(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
{
VALUE options = Qnil;
VALUE wait = Qtrue;
@@ -3221,7 +3221,7 @@ mjit_pause_m(int argc, VALUE *argv, RB_UNUSED_VAR(VALUE self))
}
static VALUE
-mjit_resume_m(VALUE _)
+jit_resume_m(VALUE _)
{
return mjit_resume();
}
@@ -3317,7 +3317,7 @@ Init_VM(void)
VALUE opts;
VALUE klass;
VALUE fcore;
- VALUE mjit;
+ VALUE jit;
/*
* Document-class: RubyVM
@@ -3362,14 +3362,17 @@ Init_VM(void)
rb_gc_register_mark_object(fcore);
rb_mRubyVMFrozenCore = fcore;
- /* ::RubyVM::MJIT
+ /* ::RubyVM::JIT
* Provides access to the Method JIT compiler of MRI.
* Of course, this module is MRI specific.
*/
- mjit = rb_define_module_under(rb_cRubyVM, "MJIT");
- rb_define_singleton_method(mjit, "enabled?", mjit_enabled_p, 0);
- rb_define_singleton_method(mjit, "pause", mjit_pause_m, -1);
- rb_define_singleton_method(mjit, "resume", mjit_resume_m, 0);
+ jit = rb_define_module_under(rb_cRubyVM, "JIT");
+ rb_define_singleton_method(jit, "enabled?", jit_enabled_p, 0);
+ rb_define_singleton_method(jit, "pause", jit_pause_m, -1);
+ rb_define_singleton_method(jit, "resume", jit_resume_m, 0);
+ /* RubyVM::MJIT for short-term backward compatibility */
+ rb_const_set(rb_cRubyVM, rb_intern("MJIT"), jit);
+ rb_deprecate_constant(rb_cRubyVM, "MJIT");
/*
* Document-class: Thread