mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
ZJIT: Support invokebuiltin opcodes (#13632)
* `invokebuiltin` * `invokebuiltin_delegate` * `invokebuiltin_delegate_leave` These instructions all call out to a C function, passing EC, self, and some number of arguments. `invokebuiltin` gets the arguments from the stack, whereas the `_delegate` instructions use a subset of the locals. `opt_invokebuiltin_delegate_leave` has a fast path for `leave`, but I'm not sure we need to do anything special for that here (FWIW YJIT appears to treat the two delegate instructions the same).
This commit is contained in:
parent
521b2fcba4
commit
3290d3d7f0
Notes:
git
2025-06-18 22:58:47 +00:00
Merged-By: k0kubun <takashikkbn@gmail.com>
4 changed files with 126 additions and 7 deletions
|
@ -76,6 +76,21 @@ class TestZJIT < Test::Unit::TestCase
|
|||
}
|
||||
end
|
||||
|
||||
def test_invokebuiltin
|
||||
assert_compiles '["."]', %q{
|
||||
def test = Dir.glob(".")
|
||||
test
|
||||
}
|
||||
end
|
||||
|
||||
def test_invokebuiltin_delegate
|
||||
assert_compiles '[[], true]', %q{
|
||||
def test = [].clone(freeze: true)
|
||||
r = test
|
||||
[r, r.frozen?]
|
||||
}
|
||||
end
|
||||
|
||||
def test_opt_plus_const
|
||||
assert_compiles '3', %q{
|
||||
def test = 1 + 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue