Implement invokebuiltin

This commit is contained in:
John Hawthorn 2021-07-08 23:33:55 -07:00 committed by Alan Wu
parent 6055078b24
commit 9951a9a8ec
3 changed files with 60 additions and 1 deletions

View file

@ -310,6 +310,19 @@ class TestYJIT < Test::Unit::TestCase
RUBY
end
def test_invokebuiltin
assert_compiles(<<~RUBY)
def foo(obj)
obj.foo = 123
obj.bar = 123
end
Foo = Struct.new(:foo, :bar)
foo(Foo.new(123))
foo(Foo.new(123))
RUBY
end
def test_super_iseq
assert_compiles(<<~'RUBY', insns: %i[invokesuper opt_plus opt_mult], result: 15)
class A