summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorAlan Wu <XrXr@users.noreply.github.com>2023-11-09 12:57:45 -0500
committerAlan Wu <XrXr@users.noreply.github.com>2023-11-10 11:51:05 -0500
commit38fe710e08db3d93b6225f9c41c18c672e602d7f (patch)
treef8555f0ff702ca401ae9fe407f75d3ad6d783dd6 /include/ruby
parent5f3fb4f4e397735783743fe52a7899b614bece20 (diff)
YJIT: Invoke PosMarker callbacks only with solid positions
Previously, PosMarker callbacks ran even when the assembler failed to assemble its contents due to insufficient space. This was problematic because when Assembler::compile() failed, the callbacks were given positions that have no valid code, contrary to general expectation. For example, we use a PosMarker callback to record VM instruction boundaries and patch in jumps to exits in case the guest program starts tracing, however, previously, we could record a location near the end of the code block, where there is no space to patch in jumps. I suspect this is the cause of the recent occurrences of rare random failures on GitHub Actions with the invariants.rs:529 "can rewrite existing code" message. `--yjit-perf` also uses PosMarker and had a similar issue. Buffer the list of callbacks to fire, and only fire them when all code in the assembler are written out successfully. It's more intuitive this way.
Diffstat (limited to 'include/ruby')
0 files changed, 0 insertions, 0 deletions