summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-12 23:19:02 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-12 23:19:02 +0000
commitc2dcb947aaf60421ca4035298059a029a0a24c26 (patch)
tree32e379fb5e91536382edf69d01327d4d1d369389
parentf27509fd1a6d18c483be13b37549df88c95e1422 (diff)
object.c: use RCLASS_M_TBL_WRAPPER for equality checks
* class.c (include_modules_at): use RCLASS_M_TBL_WRAPPER for equality checks. this avoids an unnecessary deference inside a tight loop, fixing a performance regression from r43973. * object.c (rb_obj_is_kind_of): ditto. * object.c (rb_class_inherited_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--class.c2
-rw-r--r--object.c6
3 files changed, 12 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index fdfd9a42f9..480144b387 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Dec 13 08:15:31 2013 Aman Gupta <ruby@tmm1.net>
+
+ * class.c (include_modules_at): use RCLASS_M_TBL_WRAPPER for
+ equality checks. this avoids an unnecessary deference inside a tight
+ loop, fixing a performance regression from r43973.
+ * object.c (rb_obj_is_kind_of): ditto.
+ * object.c (rb_class_inherited_p): ditto.
+
Wed Dec 13 02:00:00 2013 Kenta Murata <mrkn@mrkn.jp>
* ext/bigdecimal/bigdecimal.c (VpSetPTR): fix for limitation of the resulting
diff --git a/class.c b/class.c
index 8e00a0ce25..de837c6aa4 100644
--- a/class.c
+++ b/class.c
@@ -862,7 +862,7 @@ include_modules_at(const VALUE klass, VALUE c, VALUE module)
for (p = RCLASS_SUPER(klass); p; p = RCLASS_SUPER(p)) {
switch (BUILTIN_TYPE(p)) {
case T_ICLASS:
- if (RCLASS_M_TBL(p) == RCLASS_M_TBL(module)) {
+ if (RCLASS_M_TBL_WRAPPER(p) == RCLASS_M_TBL_WRAPPER(module)) {
if (!superclass_seen) {
c = p; /* move insertion point */
}
diff --git a/object.c b/object.c
index 3dc99367bb..346a2cd384 100644
--- a/object.c
+++ b/object.c
@@ -646,7 +646,7 @@ rb_obj_is_kind_of(VALUE obj, VALUE c)
c = class_or_module_required(c);
c = RCLASS_ORIGIN(c);
while (cl) {
- if (cl == c || RCLASS_M_TBL(cl) == RCLASS_M_TBL(c))
+ if (cl == c || RCLASS_M_TBL_WRAPPER(cl) == RCLASS_M_TBL_WRAPPER(c))
return Qtrue;
cl = RCLASS_SUPER(cl);
}
@@ -1549,13 +1549,13 @@ rb_class_inherited_p(VALUE mod, VALUE arg)
}
arg = RCLASS_ORIGIN(arg);
while (mod) {
- if (RCLASS_M_TBL(mod) == RCLASS_M_TBL(arg))
+ if (RCLASS_M_TBL_WRAPPER(mod) == RCLASS_M_TBL_WRAPPER(arg))
return Qtrue;
mod = RCLASS_SUPER(mod);
}
/* not mod < arg; check if mod > arg */
while (arg) {
- if (RCLASS_M_TBL(arg) == RCLASS_M_TBL(start))
+ if (RCLASS_M_TBL_WRAPPER(arg) == RCLASS_M_TBL_WRAPPER(start))
return Qfalse;
arg = RCLASS_SUPER(arg);
}