mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Fix perf. of RCLASS_EXT_WRITABLE
FL_TEST -> FL_TEST_RAW FL_SET -> FL_SET_RAW I was seeing bad performance on the ruby-bench getivar-module benchmark when using yjit. This was with other changes in a branch, but changes totally unrelated to accessing ivars on a class or using boxes. The change to RCLASS_PRIME_CLASSEXT_WRITABLE_P was the one that made the difference, but I changed a couple of other FL_SET uses as well. This change reduced the benchmark runs from 60ms to 40ms.
This commit is contained in:
1 parent
a3a2d461aa
commit
4bb1977b78
1 file changed
+3
-3
Notes:
git
2026-05-14 16:45:17 +00:00
+3
-3
@@ -297,7 +297,7 @@ RCLASS_PRIME_CLASSEXT_WRITABLE_P(VALUE klass)
|
||||
{
|
||||
VM_ASSERT(klass != 0, "klass should be a valid object");
|
||||
VM_ASSERT_BOXABLE_TYPE(klass);
|
||||
return FL_TEST(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
|
||||
return FL_TEST_RAW(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
|
||||
}
|
||||
|
||||
static inline void
|
||||
@@ -306,10 +306,10 @@ RCLASS_SET_PRIME_CLASSEXT_WRITABLE(VALUE klass, bool writable)
|
||||
VM_ASSERT(klass != 0, "klass should be a valid object");
|
||||
VM_ASSERT_BOXABLE_TYPE(klass);
|
||||
if (writable) {
|
||||
FL_SET(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
|
||||
FL_SET_RAW(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
|
||||
}
|
||||
else {
|
||||
FL_UNSET(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
|
||||
FL_UNSET_RAW(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user