summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-10-22 13:41:34 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-22 17:22:41 -0400
commitf80069820e1f7d44ef9c385254d498468a352021 (patch)
tree7d22c2dfc085e9dd3f478f9cd3ca312be345a308
parent7246c5b811a7b937854efb821cc457f101ad5ff1 (diff)
YJIT: Don't take VM lock on constant IC fill when disabled
While theoretically it's fine to take the lock and then immediately release it, we don't need to do it when YJIT is off.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5007
-rw-r--r--yjit_iface.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/yjit_iface.c b/yjit_iface.c
index 73b51fd50d..870a8d1efd 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -592,6 +592,8 @@ rb_yjit_constant_state_changed(void)
void
rb_yjit_constant_ic_update(const rb_iseq_t *iseq, IC ic)
{
+ if (!rb_yjit_enabled_p()) return;
+
// We can't generate code in these situations, so no need to invalidate.
// See gen_opt_getinlinecache.
if (ic->entry->ic_cref || rb_multi_ractor_p()) {