Skip to content

Work around alloca(3) in fun_bc_call().#13

Merged
ltratt merged 1 commit intoykjit:masterfrom
vext01:no-alloca
Mar 31, 2026
Merged

Work around alloca(3) in fun_bc_call().#13
ltratt merged 1 commit intoykjit:masterfrom
vext01:no-alloca

Conversation

@vext01
Copy link
Copy Markdown

@vext01 vext01 commented Mar 31, 2026

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_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.

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.
@ltratt ltratt added this pull request to the merge queue Mar 31, 2026
Merged via the queue into ykjit:master with commit 3adf0ef Mar 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants