ruby-changes:59316
From: John <ko1@a...>
Date: Wed, 18 Dec 2019 03:37:26 +0900 (JST)
Subject: [ruby-changes:59316] a01d22b8c1 (master): Check type with BUILTIN_TYPE in method cache clear
https://git.ruby-lang.org/ruby.git/commit/?id=a01d22b8c1 From a01d22b8c16d9bd44767cced8d45398493af0a7c Mon Sep 17 00:00:00 2001 From: John Hawthorn <john@h...> Date: Wed, 11 Dec 2019 15:47:49 -0800 Subject: Check type with BUILTIN_TYPE in method cache clear We know that this is a heap-allocated object (a CLASS, MODULE, or ICLASS) so we don't need to check if it is an immediate value. This should be very slightly faster. diff --git a/vm_method.c b/vm_method.c index 90ed0ba..2f1817a 100644 --- a/vm_method.c +++ b/vm_method.c @@ -70,7 +70,7 @@ rb_class_clear_method_cache(VALUE klass, VALUE arg) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L70 mjit_remove_class_serial(RCLASS_SERIAL(klass)); RCLASS_SERIAL(klass) = rb_next_class_serial(); - if (RB_TYPE_P(klass, T_ICLASS)) { + if (BUILTIN_TYPE(klass) == T_ICLASS) { struct rb_id_table *table = RCLASS_CALLABLE_M_TBL(klass); if (table) { rb_id_table_clear(table); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/