Skip to content

Commit

Permalink
Port gen_send_iseq to the new backend IR (#381)
Browse files Browse the repository at this point in the history
* Port gen_send_iseq to the new backend IR

* Replace occurrences of 8 by SIZEOF_VALUE

Co-authored-by: Maxime Chevalier-Boisvert <maximechevalierb@gmail.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
  • Loading branch information
3 people committed Aug 29, 2022
1 parent 32d9eef commit 668b99b
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 90 deletions.
10 changes: 3 additions & 7 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,12 @@ yjit_task:
bootstraptest/test_struct.rb \
bootstraptest/test_syntax.rb \
bootstraptest/test_thread.rb \
bootstraptest/test_yjit_30k_ifelse.rb \
bootstraptest/test_yjit_30k_methods.rb \
bootstraptest/test_yjit_new_backend.rb \
bootstraptest/test_yjit_rust_port.rb
# These are the btests we can't run yet on arm:
#bootstraptest/test_block.rb (missing opt_send)
#bootstraptest/test_insns.rb (missing opt_send)
#bootstraptest/test_ractor.rb ? (untested)
#bootstraptest/test_literal.rb (displacement bug)
#bootstraptest/test_yjit.rb (multiple bugs)
#bootstraptest/test_yjit_30k_ifelse.rb (missing opt_send)
#bootstraptest/test_yjit_30k_methods.rb (missing opt_send)
#bootstraptest/test_yjit.rb (out of executable memory not handled)

# full_build_script: make -j
33 changes: 33 additions & 0 deletions bootstraptest/test_yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3165,3 +3165,36 @@ def foo(path)

# opt_invokebuiltin_delegate_leave
assert_equal '[0]', %q{"\x00".unpack("c")}

# opt_send_without_block (VM_METHOD_TYPE_ISEQ)
assert_equal '1', %q{
def foo = 1
def bar = foo
bar
}
assert_equal '[1, 2, 3]', %q{
def foo(a, b) = [1, a, b]
def bar = foo(2, 3)
bar
}
assert_equal '[1, 2, 3, 4, 5, 6]', %q{
def foo(a, b, c:, d:, e: 0, f: 6) = [a, b, c, d, e, f]
def bar = foo(1, 2, c: 3, d: 4, e: 5)
bar
}
assert_equal '[1, 2, 3, 4]', %q{
def foo(a, b = 2) = [a, b]
def bar = foo(1) + foo(3, 4)
bar
}

assert_equal '1', %q{
def foo(a) = a
def bar = foo(1) { 2 }
bar
}
assert_equal '[1, 2]', %q{
def foo(a, &block) = [a, block.call]
def bar = foo(1) { 2 }
bar
}
Loading

0 comments on commit 668b99b

Please sign in to comment.