Skip to content

Commit

Permalink
Port gen_send_iseq to the new backend IR
Browse files Browse the repository at this point in the history
  • Loading branch information
k0kubun committed Aug 9, 2022
1 parent 72d58aa commit 5f9c660
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 83 deletions.
4 changes: 2 additions & 2 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,14 @@ 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_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)

# full_build_script: make -j
4 changes: 2 additions & 2 deletions .github/workflows/yjit-new-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ jobs:
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 x86:
#bootstraptest/test_ractor.rb (splitting error?)
#bootstraptest/test_yjit.rb (multiple bugs)
#bootstraptest/test_yjit_30k_ifelse.rb (missing iseq-to-iseq calls)
#bootstraptest/test_yjit_30k_methods.rb (missing iseq-to-iseq calls)

# Check that we can do a full build
#- run: make -j
32 changes: 32 additions & 0 deletions bootstraptest/test_yjit_new_backend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,38 @@ def foo()
foo()
}

# 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
}

# opt_send_without_block (VM_METHOD_TYPE_CFUNC)
assert_equal 'nil', %q{
def foo
Expand Down
Loading

0 comments on commit 5f9c660

Please sign in to comment.