ZJIT: Mark the code region executable on partial failures #13937
+15
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a random bus error on yjit-bench for arm64.
ZJIT compilation currently has three phases that run
asm.compile()
:gen_function()
: Compiles the first ISEQ bodygen_entry()
: Compiles the trampoline to enter the ISEQ's JIT codegen_iseq()
: Compiles callee ISEQs for JIT-to-JIT callsOnce it reaches the
emit
pass of (1), it modifies the code region state. So, even if (2) or (3) fails, you need to runcb.mark_all_executable()
after (1). Currently, it does not callcb.mark_all_executable()
when (3) fails, so that's the problem this PR fixes. To reduce the possibility of making this mistake again, I made a wrapper function that does it.