8000 ZJIT: Write a callee frame on JIT-to-JIT calls by k0kubun · Pull Request #13579 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

ZJIT: Write a callee frame on JIT-to-JIT calls #13579

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 13, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test side exits with locals
  • Loading branch information
k0kubun committed Jun 12, 2025
commit 5b621b11052e772c3bd0caef23f9eda7753d881a
27 changes: 27 additions & 0 deletions test/ruby/test_zjit.rb
Original file line number Diff line number Diff line change
A220 Expand Up @@ -102,6 +102,17 @@ def test(a) = 1 + a
}, call_threshold: 2
end

def test_opt_plus_type_guard_exit_with_locals
assert_compiles '[6, 6.0]', %q{
def test(a)
local = 3
1 + a + local
end
test(1) # profile opt_plus
[test(2), test(2.0)]
}, call_threshold: 2
end

def test_opt_plus_type_guard_nested_exit
assert_compiles '[4, 4.0]', %q{
def side_exit(n) = 1 + n
Expand All @@ -112,6 +123,22 @@ def entry(n) = jit_frame(n)
}, call_threshold: 2
end

def test_opt_plus_type_guard_nested_exit_with_locals
assert_compiles '[9, 9.0]', %q{
def side_exit(n)
local = 2
1 + n + local
end
def jit_frame(n)
local = 3
1 + side_exit(n) + local
end
def entry(n) = jit_frame(n)
entry(2) # profile send
[entry(2), entry(2.0)]
}, call_threshold: 2
end

# Test argument ordering
def test_opt_minus
assert_compiles '2', %q{
Expand Down
0