From 7c75dbe51e9fd9ebd84bc796acec4a4e60c5d367 Mon Sep 17 00:00:00 2001 From: Max Bernstein Date: Fri, 23 Jan 2026 16:14:59 -0500 Subject: [PATCH 1/2] ZJIT: Reset all the counters in RubyVM::ZJIT::reset_stats! (#15950) We previously forgot about these. --- zjit/src/stats.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zjit/src/stats.rs b/zjit/src/stats.rs index 556a1417a42338..96d75b7aec84b7 100644 --- a/zjit/src/stats.rs +++ b/zjit/src/stats.rs @@ -717,6 +717,21 @@ pub extern "C" fn rb_zjit_reset_stats_bang(_ec: EcPtr, _self: VALUE) -> VALUE { // Reset exit counters for YARV instructions exit_counters.as_mut_slice().fill(0); + // Reset send fallback counters + ZJITState::get_send_fallback_counters().as_mut_slice().fill(0); + + // Reset not-inlined counters + ZJITState::get_not_inlined_cfunc_counter_pointers().iter_mut() + .for_each(|b| { **(b.1) = 0; }); + + // Reset not-annotated counters + ZJITState::get_not_annotated_cfunc_counter_pointers().iter_mut() + .for_each(|b| { **(b.1) = 0; }); + + // Reset ccall counters + ZJITState::get_ccall_counter_pointers().iter_mut() + .for_each(|b| { **(b.1) = 0; }); + Qnil } From 887913efc0fecdcfd67c86d52d1d92ad79c23fac Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 22 Jan 2026 17:12:59 -0500 Subject: [PATCH 2/2] [DOC] Improve docs for eval --- vm_eval.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/vm_eval.c b/vm_eval.c index 707344718bced0..652fc4d85feac2 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -2031,21 +2031,38 @@ eval_string_with_scope(VALUE scope, VALUE src, VALUE file, int line) } /* - * call-seq: - * eval(string [, binding [, filename [,lineno]]]) -> obj + * call-seq: + * eval(string, binding = nil, filename = default_filename, lineno = 1) -> obj * - * Evaluates the Ruby expression(s) in string. If - * binding is given, which must be a Binding object, the - * evaluation is performed in its context. If the optional - * filename and lineno parameters are present, they - * will be used when reporting syntax errors. + * Evaluates the Ruby expression(s) in +string+. Returns the result of the last + * expression. * - * def get_binding(str) - * return binding - * end - * str = "hello" - * eval "str + ' Fred'" #=> "hello Fred" - * eval "str + ' Fred'", get_binding("bye") #=> "bye Fred" + * str = "Hello" + * eval("str + ' World'") # => "Hello World" + * + * If +binding+ is given, which must be a Binding object, the + * evaluation is performed in its context. Otherwise, the + * evaluation is performed in the context of the caller. + * + * def get_binding(str) = binding + * str = "Hello" + * eval("str + ' World'", get_binding("Bye")) # => "Bye World" + * + * If the optional +filename+ is given, it will be used as the + * filename of the evaluation (for __FILE__ and errors). + * Otherwise, it will default to (eval at __FILE__:__LINE__) + * where __FILE__ and __LINE__ are the filename and + * line number of the caller, respectively. + * + * eval("puts __FILE__") # => "(eval at test.rb:1)" + * eval("puts __FILE__", nil, "foobar.rb") # => "foobar.rb" + * + * If the optional +lineno+ is given, it will be used as the + * line number of the evaluation (for __LINE__ and errors). + * Otherwise, it will default to 1. + * + * eval("puts __LINE__") # => 1 + * eval("puts __LINE__", nil, "foobar.rb", 10) # => 10 */ VALUE