From d4cc77e7b6107b136e977e9b107b2d50aaa42314 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Thu, 25 Jan 2024 08:23:26 -0800 Subject: YJIT: Add a counter for invokebuiltin exits (#9696) --- yjit.rb | 1 + yjit/src/codegen.rs | 2 ++ yjit/src/stats.rs | 2 ++ 3 files changed, 5 insertions(+) diff --git a/yjit.rb b/yjit.rb index c25ea8997d..06cb75adb1 100644 --- a/yjit.rb +++ b/yjit.rb @@ -271,6 +271,7 @@ module RubyVM::YJIT branchunless definedivar expandarray + invokebuiltin jump leave objtostring diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 33298eed5c..06adbe8553 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -8786,6 +8786,7 @@ fn gen_invokebuiltin( // ec, self, and arguments if bf_argc + 2 > C_ARG_OPNDS.len() { + incr_counter!(invokebuiltin_too_many_args); return None; } @@ -8825,6 +8826,7 @@ fn gen_opt_invokebuiltin_delegate( // ec, self, and arguments if bf_argc + 2 > (C_ARG_OPNDS.len() as i32) { + incr_counter!(invokebuiltin_too_many_args); return None; } diff --git a/yjit/src/stats.rs b/yjit/src/stats.rs index b6add639c1..7e83fa504f 100644 --- a/yjit/src/stats.rs +++ b/yjit/src/stats.rs @@ -468,6 +468,8 @@ make_counters! { setlocal_wb_required, + invokebuiltin_too_many_args, + opt_plus_overflow, opt_minus_overflow, opt_mult_overflow, -- cgit v1.2.3