From 39a34694a0e33e18b4ac6e43cb8042e2d818ecd4 Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Tue, 28 Mar 2023 15:21:19 -0400 Subject: YJIT: Add `--yjit-pause` and `RubyVM::YJIT.resume` (#7609) * YJIT: Add --yjit-pause and RubyVM::YJIT.resume This allows booting YJIT in a suspended state. We chose to add a new command line option as opposed to simply allowing YJIT.resume to work without any command line option because it allows for combining with YJIT tuning command line options. It also simpifies implementation. Paired with Kokubun and Maxime. * Update yjit.rb Co-authored-by: Takashi Kokubun --------- Co-authored-by: Alan Wu Co-authored-by: Takashi Kokubun --- yjit.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'yjit.rb') diff --git a/yjit.rb b/yjit.rb index 7d56bf0517..343f5f0ed8 100644 --- a/yjit.rb +++ b/yjit.rb @@ -29,6 +29,11 @@ module RubyVM::YJIT Primitive.rb_yjit_reset_stats_bang end + # Resume YJIT compilation after paused on startup with --yjit-pause + def self.resume + Primitive.rb_yjit_resume + end + # If --yjit-trace-exits is enabled parse the hashes from # Primitive.rb_yjit_get_exit_locations into a format readable # by Stackprof. This will allow us to find the exact location of a -- cgit v1.2.1