ruby-changes:51747
From: nobu <ko1@a...>
Date: Thu, 12 Jul 2018 14:01:09 +0900 (JST)
Subject: [ruby-changes:51747] nobu:r63959 (trunk): Improve branch misses
nobu 2018-07-12 14:01:04 +0900 (Thu, 12 Jul 2018) New Revision: 63959 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=63959 Log: Improve branch misses Improve branch misses on frozen object predicate checks negatively affecting performance of most setters as most objects are not frozen. [Fix GH-1913] From: Lourens Naud?\195?\169 <lourens@b...> Modified files: trunk/include/ruby/intern.h Index: include/ruby/intern.h =================================================================== --- include/ruby/intern.h (revision 63958) +++ include/ruby/intern.h (revision 63959) @@ -254,7 +254,7 @@ void rb_check_frozen(VALUE); https://github.com/ruby/ruby/blob/trunk/include/ruby/intern.h#L254 void rb_check_trusted(VALUE); #define rb_check_frozen_internal(obj) do { \ VALUE frozen_obj = (obj); \ - if (RB_OBJ_FROZEN(frozen_obj)) { \ + if (RB_UNLIKELY(RB_OBJ_FROZEN(frozen_obj))) { \ rb_error_frozen_object(frozen_obj); \ } \ } while (0) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/