GH-131798: Remove JIT guards for dict, frozenset, list, set, and tuple#132289
GH-131798: Remove JIT guards for dict, frozenset, list, set, and tuple#132289brandtbucher merged 7 commits intopython:mainfrom
dict, frozenset, list, set, and tuple#132289Conversation
|
@Zheaoli and @tomasr8, you might be interested in checking this out. Specifically, see the changes in You can see that this PR breaks up the old, larger |
| op(_TO_BOOL_LIST, (value -- res)) { | ||
| int already_bool = optimize_to_bool(this_instr, ctx, value, &res); | ||
| if (!already_bool) { | ||
| sym_set_type(value, &PyList_Type); |
There was a problem hiding this comment.
Does CONTAIN_OP_SET and CONTAIN_OP_DICT need to remove their sym setting type as well? Or is that not even happening at the moment?
There was a problem hiding this comment.
Not happening currently,. _CONTAINS_OP_SET can't even set anything, since it handles both set and frozenset (this might be worth re-evaluating, or splitting up).
Thanks! I think I might need some time to understand this PR! Thanks for your patience! |
|
Going to go ahead and merge this to reduce the risk of merge conflicts, but let me know if you have any questions @Zheaoli! |
According to the stats, this removes:
tupleguards (25%)set/frozensetguards (19%)dictguards (42%)listguards (34%)It also fixes a bug that I encountered in the optimizer's logic for
_UNPACK_SEQUENCE_TUPLE, which puts items on the stack in reverse order.