Work around alloca(3) in fun_bc_call().#13
Merged
ltratt merged 1 commit intoykjit:masterfrom Mar 31, 2026
Merged
Conversation
alloca(3) causes the frame to have dynamic size, which in-turn breaks stackmaps. For this reason, functions which use alloca(3) are `yk_outline`d by ykllvm. micropython avoids lots of heap allocation by storing small code states on the stack with alloca(3). This means we can't trace. This change nullifies the optimisation, so we always allocate code states on te GC heap. If you were to add `yk_unroll_safe` and `yk_indirect_inline` to `fun_bc_call()`, then it would not be `yk_outline` and we'd have a full definition in the AOR IR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
alloca(3) causes the frame to have dynamic size, which in-turn breaks stackmaps. For this reason, functions which use alloca(3) are
yk_outlined by ykllvm.micropython avoids lots of heap allocation by storing small code states on the stack with alloca(3). This means we can't trace.
This change nullifies the optimisation, so we always allocate code states on te GC heap.
If you were to add
yk_unroll_safeandyk_indirect_inlinetofun_bc_call(), then it would not beyk_outlineand we'd have a full definition in the AOR IR.