-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
gh-106581: Start projecting through calls #107793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This is only the first step for doing `CALL` in Tier 2. The next step involves tracing into the called code object. After that we'll have to do the remaining `CALL` specialization. Finally we'll have to tweak various things like `KW_NAMES`, and possibly move the `NULL` (for method calls) *above* the callable. But those are things for future PRs. Note: this moves setting `frame->return_offset` directly in front of `DISPATCH_INLINED()`, to make it easier to move it into `_PUSH_FRAME`.
Instead, the special case is an opcode using SAVE_FRAME_STATE(). Introducing #if TIER_ONE and #if TIER_TWO so we can implement _PUSH_FRAME differently for both tiers.
Instead, we special-case SAVE_IP: - Its Tier 2 expansion sets oparg to the instruction offset - In Tier 1 it is a no-op (and skipped if present in a macro)
59d41a9
to
61958fc
Compare
This leaks quite a bit, probably in the function-by-version cache. |
I suspect I have to redo the function version cache using weak references if I want all tests to pass. Unfortunately that will slow things down. Having borrowed references to function objects in a cache seems horrible. What else could we try? Perhaps the cache could contain code objects (which are what we want anyways, so perhaps a scheme like the current one doesn't break so many tests), and when a function's (BTW, why is |
Or perhaps we could leave borrowed references in the function version cache that we remove when the function is deleted? (Also when the function's |
- This uses the function-by-version cache I just added - There's not yet a way to trace back via `RETURN_VALUE`
This should fix leaks and hopefully most failing tests.
d7b7e01
to
b408b2b
Compare
For now, builds on gh-107760.
TODO:
_Py_EnterRecursivePy
(see gh-106581: SplitCALL_PY_EXACT_ARGS
into uops #107760) and_Py_LeaveRecursiveCallPy
(see Support RETURN from tracing through a function #107925)