summaryrefslogtreecommitdiff
path: root/yjit_iface.c
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2021-06-23 20:28:42 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:36 -0400
commit3996e0ab07d06b7685eecd56a542e9672702dee2 (patch)
treed659767dc3ce523b4bfae0fa23a8b95e0a4e9513 /yjit_iface.c
parent6883aeda77c09c4982080f968491eacbc43a47e1 (diff)
Add tests, comments, and an assert for invokesuper
Diffstat (limited to 'yjit_iface.c')
-rw-r--r--yjit_iface.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/yjit_iface.c b/yjit_iface.c
index ba3e5bbb83..3d589f5e5e 100644
--- a/yjit_iface.c
+++ b/yjit_iface.c
@@ -218,8 +218,9 @@ add_lookup_dependency_i(st_data_t *key, st_data_t *value, st_data_t data, int ex
return ST_CONTINUE;
}
-// Remember that a block assumes that rb_callable_method_entry(receiver_klass, mid) == cme and that
-// cme is vald.
+// Remember that a block assumes that
+// `rb_callable_method_entry(receiver_klass, cme->called_id) == cme` and that
+// `cme` is valid.
// When either of these assumptions becomes invalid, rb_yjit_method_lookup_change() or
// rb_yjit_cme_invalidate() invalidates the block.
//
@@ -230,6 +231,7 @@ assume_method_lookup_stable(VALUE receiver_klass, const rb_callable_method_entry
RUBY_ASSERT(!block->receiver_klass && !block->callee_cme);
RUBY_ASSERT(cme_validity_dependency);
RUBY_ASSERT(method_lookup_dependency);
+ RUBY_ASSERT(rb_callable_method_entry(receiver_klass, cme->called_id) == cme);
RUBY_ASSERT_ALWAYS(RB_TYPE_P(receiver_klass, T_CLASS));
RUBY_ASSERT_ALWAYS(!rb_objspace_garbage_object_p(receiver_klass));