gh-145742: Pre-tag operands for _LOAD_CONST_INLINE_BORROW variants#148081
gh-145742: Pre-tag operands for _LOAD_CONST_INLINE_BORROW variants#148081corona10 wants to merge 13 commits intopython:mainfrom
Conversation
|
@Fidget-Spinner @markshannon PTAL when you have times :) |
|
I’ve just resolved all the conflicts. Gentle ping to @markshannon and @Fidget-Spinner. |
|
Thanks for doing this. There is work underway to remove the many variants of |
|
Got it |
|
@markshannon I've resolved conflicts with the latest main and simplified the pre-tagging/untagging to be path-based (auto-tagging in add_op() when the opcode is a BORROW variant). PTAL. |
markshannon
left a comment
There was a problem hiding this comment.
Have you tested this with Py_STACKREF_DEBUG set?
| #define PyStackRef_FromPreTagged(ptr) _PyStackRef_FromPreTagged((uintptr_t)(ptr)) | ||
|
|
||
| /* Tag a PyObject pointer as a borrowed operand for BORROW variants. */ | ||
| #define PyStackRef_TagBorrow(ptr) \ |
There was a problem hiding this comment.
Doesn't it need defining for Py_STACKREF_DEBUG as well?
Can you make this an inline function, for type safety?
| PyObject *ptr = (PyObject *)CURRENT_OPERAND0_64(); | ||
| value = PyStackRef_FromPyObjectBorrow(ptr); | ||
| _PyFrame_SetStackPointer(frame, stack_pointer); | ||
| value = PyStackRef_FromPreTagged(ptr); |
There was a problem hiding this comment.
You need to whitelist PyStackRef_FromPreTagged as non-escaping
Uh oh!
There was an error while loading. Please reload this page.