aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-12 05:01:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-12 05:01:04 +0000
commitcf3185daf1b7b21500f86a93406126b8d36e6236 (patch)
tree62c006c764d9b51aaac31049aa416c5c1c1b5832 /include
parent605bc305bb2e33c3fa56808671429f73c8a60d75 (diff)
downloadruby-cf3185daf1b7b21500f86a93406126b8d36e6236.tar.gz
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é <lourens@bearmetal.eu> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/intern.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 3999592cdf..9ecd8ce8e2 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -254,7 +254,7 @@ void rb_check_frozen(VALUE);
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)