Skip to content

Code generator: support variable stack effects in macros #106812

Closed
@gvanrossum

Description

@gvanrossum

Currently you can't split e.g.

inst(CALL_PY_EXACT_ARGS, (unused/1, func_version/2, method, callable, args[oparg] -- unused))
{ ... }

into two micro-ops

op(_CHECK_PY_FUNCTION, (func_version/2, method, callable, args[oparg] -- method, callable, args[oparg]))
{ ... }
op(_CALL_PY_EXACT_ARGS, (method, callable, args[oparg] -- unused))
{ ... }
macro(CALL_PY_EXACT_ARGS) = unused/1 + _CHECK_PY_FUNCTION + _CALL_PY_EXACT_ARGS;

We need at least to handle micro-ops that have the same variable-length input effect as output effect, and a final (action) op that has a variable-length stack input effect and a fixed output effect. This should handle all the CALL specializations. (For UNPACK_SEQUENCE we also need to support a fixed input effect and a variable output effect, in he action op.)

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions