| Age | Commit message (Collapse) | Author |
|
We should only clear the JIT function when the entry point is
invalidated. Right now we only support compiling functions with a PC
offset of zero (functions that take optional parameters can start at
non-zero PC), so this patch just checks that the index is 0 before
clearing the jit function
|
|
For use cases where you want to collect the metrics
for a specific piece of code (typically a web request)
you can have the stats turned off by default and then
turn them on at runtime before executing the code you care
about.
|
|
|
|
This change fixes some cases where YJIT fails to fire tracing events.
Most of the situations YJIT did not handle correctly involves enabling
tracing while running inside generated code.
A new operation to invalidate all generated code is added, which uses
patching to make generated code exit at the next VM instruction
boundary. A new routine called `jit_prepare_routine_call()` is
introduced to facilitate this and should be used when generating code
that could allocate, or could otherwise use `RB_VM_LOCK_ENTER()`.
The `c_return` event is fired in the middle of an instruction as opposed
to at an instruction boundary, so it requires special handling. C method
call return points are patched to go to a fucntion which does everything
the interpreter does, including firing the `c_return` event. The
generated code for C method calls normally does not fire the event.
Invalided code should not change after patching so the exits are not
clobbered. A new variable is introduced to track the region of code that
should not change.
|
|
|
|
|
|
|
|
RUBY_DEBUG have a very significant performance overhead. Enough that
YJIT with RUBY_DEBUG is noticeably slower than the interpreter without
RUBY_DEBUG.
This makes it hard to collect yjit-stats in production environments.
By allowing to collect JIT statistics without the RUBy_DEBUG overhead,
I hope to make such use cases smoother.
|
|
The FIXME is there so we remember to investigate why insns clears the
temporary array. Is this necessary? If it's not we can remove it from
both.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Similar to the previous fix to ctx_clear_local_types, we must detach
mappings to a local if we are changing its value.
|
|
Previously all stack operands would become unknown once the stack grew
beyond a certain size. This worked, but unnecessarily hid available
information.
|
|
|
|
|
|
|
|
If we hit this at PC > 0 (ie. with an optional argument) the provided
types and context are likely incorrect and it is likely this block can't
be used.
|
|
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
|
|
Nobu pointed out that saving the old ci to a local is enough to keep it
reachable.
|
|
This reverts commit 1e0f2e4b09ca9443524acf4b50ffd50a80f330f3.
|
|
|
|
|
|
This should have referenced MAX_TEMP_TYPES, not MAX_LOCAL_TYPES.
|
|
|
|
|
|
|
|
|
|
|
|
These instructions are marked as not leaf in insns.def, which indicate
that they could raise exceptions and/or call Ruby methods.
|
|
Adds yjit support for setting global variables.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Co-authored-by: John Hawthorn <john@hawthorn.email>
|
|
return Qnil
|
|
Adds getglobal to yjit and a test for it.
Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
|
|
Previously, under the scraper, this would side-exit because it was
returning to a C method. Now that we use the jit_func entrypoint, this
test no longer side-exits.
|
|
|
|
The old code didn't keep old_operands[0] reachable while allocating. You
can crash it by requiring erb under GC stress mode.
|
|
This is just for helping my own understanding, but could be useful for others as well.
|
|
Clear out any JIT code on iseqs when tracepoints get enabled. We can't
handle tracepoints right now, so we'll just try to recompile later.
|
|
If `--disable-jit-support` is passed to configure, then `jit_func` is
removed from the iseq body and we can't compile YJIT. This commit
detects when the JIT function pointer is gone and disables YJIT in that
case.
|
|
Now that we're using the jit function entry point, we don't need the
scraper. Thank you for your service, scraper. ❤️
|
|
The JIT entry point passes the CFP as RSI and the EC as RDI. Lets match
that so we don't have to shuffle registers around.
|
|
|
|
|
|
Instead of mutating the iseqs, just clear the JIT function.
|
|
Methods with optional parameters don't always start executing at the
first PC, but we compile all methods assuming that they do. This commit
adds a guard to ensure that we're actually starting at the first PC for
methods with optional params
|
|
|