Switch to calling tp_richcompare
The notable places that are changed are PyEq, PyLt, and compare/compareInternal. The old codepaths are still in there (though thankfully now with reduced duplication with cpython), since for anything that defines a Python-level __lt__, it's better to call that with our rewriting support, rather than calling it through slot_tp_richcompare. The control flow is kind of messy, since I don't think we know what the right long-term organization is for these kinds of things. But basically, it's: - if we can't rewrite, just call the C slot - if we can rewrite, and we think calling tp_richcompare is profitable (ie it's not slot_tp_richcompare), we call that and emit a call to it in the patchpoint - otherwise, we try calling the python attribute Actual conversion of our attributes to tp_richcompare in the next commit.
Showing
Please register or sign in to comment