pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/pull/148081/files

f="https://github.githubassets.com/assets/primer-primitives-10bf9dd67e3d70bd.css" /> gh-145742: Pre-tag operands for _LOAD_CONST_INLINE_BORROW variants by corona10 · Pull Request #148081 · python/cpython · GitHub
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Include/internal/pycore_stackref.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,25 @@ PyStackRef_FromPyObjectBorrow(PyObject *obj)
return (_PyStackRef){ .bits = (uintptr_t)obj | Py_TAG_REFCNT};
}

/* Create a stackref from a pre-tagged operand (tag bits already set).
Used by _LOAD_CONST_INLINE_BORROW variants where the operand is
tagged at trace creation time to avoid tagging on every execution. */
static inline _PyStackRef
_PyStackRef_FromPreTagged(uintptr_t tagged)
{
assert(tagged & Py_TAG_REFCNT);
return (_PyStackRef){ .bits = tagged };
}
#define PyStackRef_FromPreTagged(ptr) _PyStackRef_FromPreTagged((uintptr_t)(ptr))

/* Tag a PyObject pointer as a borrowed operand for BORROW variants. */
#define PyStackRef_TagBorrow(ptr) \
((uintptr_t)(ptr) | Py_TAG_REFCNT)

/* Strip tag bits from a pre-tagged operand to recover the PyObject pointer. */
#define PyStackRef_UntagBorrow(tagged) \
((PyObject *)((uintptr_t)(tagged) & ~Py_TAG_BITS))

/* WARNING: This macro evaluates its argument more than once */
#ifdef _WIN32
#define PyStackRef_DUP(REF) \
Expand Down
Loading
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy