summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authorAlan Wu <[email protected]>2024-07-19 15:53:16 -0400
committerAlan Wu <[email protected]>2024-07-19 17:47:12 -0400
commit8cf708d7b495f62d6239a49af25c362d0156e6aa (patch)
tree680e215418a2555119c0b8413bff7b872162dbb2 /error.c
parent30f2d69825ff402bbff0398dcf4f5ab8a6e62c7f (diff)
Make rb_check_frozen_inline() static inline again
Since 730e3b2ce01915c4a98b79bb281b2c38a9ff1131 ("Stop exposing `rb_str_chilled_p`"), we noticed a speed loss on a few benchmarks that are string operations heavy. This is partially due to routines no longer having the options to inline rb_check_frozen_inline() in non-LTO builds. Make it an inlining candidate again to recover speed. Testing this patch on my machine, the fannkuchredux benchmark gets a 1.15 speed-up with YJIT and 1.03 without YJIT.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/11211
Diffstat (limited to 'error.c')
-rw-r--r--error.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/error.c b/error.c
index 07693197b9..ef646c55c7 100644
--- a/error.c
+++ b/error.c
@@ -4001,13 +4001,7 @@ rb_error_frozen_object(VALUE frozen_obj)
void
rb_check_frozen(VALUE obj)
{
- if (RB_UNLIKELY(RB_OBJ_FROZEN(obj))) {
- rb_error_frozen_object(obj);
- }
-
- if (RB_UNLIKELY(CHILLED_STRING_P(obj))) {
- rb_str_modify(obj);
- }
+ rb_check_frozen_inline(obj);
}
void