summaryrefslogtreecommitdiff
path: root/bootstraptest/test_yjit.rb
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maximechevalierb@gmail.com>2021-04-27 16:27:56 -0400
committerAlan Wu <XrXr@users.noreply.github.com>2021-10-20 18:19:34 -0400
commitbce6dea72d0081e4777b80e1de3b76fbfcde9f0a (patch)
treefb94aa93056e0795fca1a284a8b82d0628325d58 /bootstraptest/test_yjit.rb
parentcfaf6013036bf1294d4dead83155daeb5a95308e (diff)
Fix assertions in `invalidate_block_version()`, add small repro (#14)
* Fix block invalidation assertions * Add Alan's small repro for double invalidation bug
Diffstat (limited to 'bootstraptest/test_yjit.rb')
-rw-r--r--bootstraptest/test_yjit.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/bootstraptest/test_yjit.rb b/bootstraptest/test_yjit.rb
index 5c7e74635a..d02506b2b8 100644
--- a/bootstraptest/test_yjit.rb
+++ b/bootstraptest/test_yjit.rb
@@ -172,6 +172,28 @@ assert_equal '1', %q{
retval
}
+# Code invalidation and opt_getinlinecache
+assert_normal_exit %q{
+ class Foo; end
+
+ # Uses the class constant Foo
+ def use_constant(arg)
+ [Foo.new, arg]
+ end
+
+ def propagate_type
+ i = Array.new
+ i.itself # make it remember that i is on-heap
+ use_constant(i)
+ end
+
+ propagate_type
+ propagate_type
+ use_constant(Foo.new)
+ class Jo; end # bump global constant state
+ use_constant(3)
+}
+
# Method redefinition (code invalidation) and GC
assert_equal '7', %q{
def bar()