Skip to content

Commit 05dec1a

Browse files
committed
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.
1 parent 447c952 commit 05dec1a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

internal/class.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ RCLASS_PRIME_CLASSEXT_WRITABLE_P(VALUE klass)
301301
{
302302
VM_ASSERT(klass != 0, "klass should be a valid object");
303303
VM_ASSERT_BOXABLE_TYPE(klass);
304-
return FL_TEST(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
304+
return FL_TEST_RAW(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
305305
}
306306

307307
static inline void
@@ -310,10 +310,10 @@ RCLASS_SET_PRIME_CLASSEXT_WRITABLE(VALUE klass, bool writable)
310310
VM_ASSERT(klass != 0, "klass should be a valid object");
311311
VM_ASSERT_BOXABLE_TYPE(klass);
312312
if (writable) {
313-
FL_SET(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
313+
FL_SET_RAW(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
314314
}
315315
else {
316-
FL_UNSET(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
316+
FL_UNSET_RAW(klass, RCLASS_PRIME_CLASSEXT_WRITABLE);
317317
}
318318
}
319319

0 commit comments

Comments
 (0)