diff --git a/rjit.c b/rjit.c index 773468d383..ccd0b57f13 100644 --- a/rjit.c +++ b/rjit.c @@ -488,7 +488,7 @@ rb_rjit_init(const struct rjit_options *opts) rb_cRJITCfpPtr = rb_funcall(rb_mRJITC, rb_intern("rb_control_frame_t"), 0); rb_mRJITHooks = rb_const_get(rb_mRJIT, rb_intern("Hooks")); - rb_rjit_call_p = true; + rb_rjit_call_p = !rb_rjit_opts.pause; rjit_stats_p = rb_rjit_opts.stats; // Normalize options diff --git a/rjit.rb b/rjit.rb index 54aa38cd75..da75576746 100644 --- a/rjit.rb +++ b/rjit.rb @@ -4,14 +4,12 @@ module RubyVM::RJIT Primitive.cexpr! 'RBOOL(rb_rjit_enabled)' end - # Stop generating JITed code. - def self.pause - # TODO: implement this - end - - # Start generating JITed code again after pause. + # Start generating JITed code again after --rjit-pause. def self.resume - # TODO: implement this + Primitive.cstmt! %{ + rb_rjit_call_p = true; + return Qnil; + } end if Primitive.rjit_stats_enabled_p