Skip to content

Micro-ops that have side-exits are sometimes marked as "escaping", when they should not be. #137276

@markshannon

Description

@markshannon

We tag micro-ops as "escaping", using HAS_ESCAPES_FLAG, when they call out to a function that might change the state of the world.

However, if that call only happens on an exit branch, then there is no escape if execution stays on trace.
In those cases we should not mark the micro-op as escaping.

For example: _GUARD_IS_NONE_POP is defined as follows:

            int is_none = PyStackRef_IsNone(val);
            if (!is_none) {
                PyStackRef_CLOSE(val);
                SYNC_SP();
                EXIT_IF(1);
            }
            DEAD(val);

The call to PyStackRef_CLOSE only occurs on the exit branch. So, if execution continues past _GUARD_IS_NONE_POP then no escaping call has been made. Therefore we shouldn't mark _GUARD_IS_NONE_POP as escaping.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagetopic-JIT

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions