GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Interpreter code generators need to be able to handle basic flow control · Issue #123391 · python/cpython

Interpreter code generators need to be able to handle basic flow control #123391

New issue
Copy link
New issue
Copy link
Closed
#124392
Closed
Interpreter code generators need to be able to handle basic flow control#123391
#124392
Copy link
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

Description

@markshannon
markshannon
opened on Aug 27, 2024
Issue body actions

In order to be able to flush the stack efficiently around escaping calls, the interpreter code generators need to be able to handle simple-ish flow control.

For example, in this code:

  op(_CHECK_PERIODIC, (--)) {
      if (_Py_atomic_load_uintptr_relaxed(&tstate->eval_breaker) & _PY_EVAL_EVENTS_MASK) {
          int err = _Py_HandlePending(tstate);
          ERROR_IF(err != 0, error);
      }
  }

The general shape is:

    if (cond) {
        *escaping_call()*
    }

We want to be able to track the flow control so that we can spill around the call, but not on the fast path:

   if (cond) {
        SPILL_STACK();
        *escaping_call()*
        RELOAD_STACK();
    }

We cannot currently do this.

Linked PRs

  • GH-123391: Code generators: Track stack and locals in if statements. #123397
  • GH-123391: Code generators: Track stack and locals in if statements. #123469

Activity

  1. picnixz
    added
    type-featureA feature request or enhancementA feature request or enhancement
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on Aug 27, 2024
  2. markshannon
    closed this as completedin #124392on Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.