It seems not-uncommon for methods to have no IV, ISE, or ICVARC caches.
Calling malloc with 0 will actually allocate something, so if there
aren't any caches (`ISEQ_IS_SIZE(body) == 0`), then we can avoid
allocating memory by not calling malloc. If there are no caches, then
theoretically nobody should be reading from the buffer anyway.
This saves about 1MB on Lobsters benchmark.
* YJIT: Skip Insn::Comment and format!
if disasm is disabled
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
* YJIT: Get rid of asm.comment
---------
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Previously, TestStack#test_machine_stack_size failed pretty consistently
on ARM64 macOS, with Rust code and part of the interpreter used for
per-instruction fallback (rb_vm_invokeblock() and friends) touching the
stack guard page and crashing with SEGV. I've also seen the same test
fail on x64 Linux, though with a different symptom.
This simplifies how we handle multi-targets, and also fixes a bug we
had where for loops were always getting multi-targets, even when there
was only a single target.
https://github.com/ruby/yarp/commit/31eb8b7ad5
This rarely used node holds information about the local variables
that need to get written in the case a regular expression is used on
the left-hand side of a =~ operator and it has named capture groups.
Note that we already "handled" these nodes by adding locals to the
AST, but we didn't actually expose this information, making it
difficult to compile.
The general idea behind this node is that it maintains the ability
for consumers to find all of the call nodes in the tree easily so
it's not flattening down. However, it should be okay because you
hopefully don't need any information in the call node to determine
what to compile because the locals list is on the top level.
https://github.com/ruby/yarp/commit/e136e7f9a8
Following up on #1483, this removes our usage of varargs entirely.
Under the new approach we make explicit methods for the various
signatures. Because we know the type of everything any it's very
consistent, this makes it easier for compilers to inline.
Also, I renamed the functions to be more consistent with each other
so that we'll have some more internal consistency.
https://github.com/ruby/yarp/commit/87af9ba29b
* Fix `io_buffer_get_string` default length computation.
When an offset bigger than the size is given, the resulting length will be
computed incorrectly. Raise an argument error in this case.
* Validate all arguments.
`Process::Status#&` and `Process::Status#>>` are provided only for
the backward compatibility with older Ruby than 1.8 where `$?` was
a `Fixnum`, and the knowledge about internals of system dependent
macros is necessary to use them. Modern programs and libraries
should not need these methods.