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 25, 2022
1 parent 9a413db commit bdaf2b9
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 93 deletions.
12 changes: 4 additions & 8 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:

task:
name: Arm64 Graviton2 / $CC
skip: "changesIncludeOnly('doc/**', '**.{md,rdoc}', '.document')"
skip: "changesIncludeOnly('doc/**', '**.{md,rdoc}')"
arm_container:
# We use the arm64 images at https://github.com/ruby/ruby-ci-image/pkgs/container/ruby-ci-image .
image: ghcr.io/ruby/ruby-ci-image:$CC
Expand Down 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
4 changes: 2 additions & 2 deletions .github/workflows/yjit-new-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ 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_yjit.rb (out of executable memory not handled)
#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,28 @@ 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
}

# opt_send_without_block (VM_METHOD_TYPE_CFUNC)
assert_equal 'nil', %q{
def foo
Expand Down Expand Up @@ -428,6 +450,16 @@ def foo()
assert_equal '["1", "2"]', %q{def foo = [1, 2].map(&:to_s); foo}
assert_equal '["1", "2"]', %q{def foo = [1, 2].map { |i| i.to_s }; foo}
assert_equal '["bar"]', %q{def foo = ["foo/bar"].map(&File.method(:basename)); foo}
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
}

# getglobal
assert_equal '333', %q{
Expand Down
Loading

0 comments on commit bdaf2b9

Please sign in to comment.