mirror of
https://github.com/python/cpython.git
synced 2026-04-15 00:00:57 +00:00
gh-146381: Constant-fold frozendict subscript lookups via REPLACE_OPCODE_IF_EVALUATES_PURE (gh-146490)
This commit is contained in:
parent
a933e9ccee
commit
5992238986
4 changed files with 86 additions and 1 deletions
|
|
@ -485,6 +485,9 @@ dummy_func(void) {
|
|||
res = sym_new_not_null(ctx);
|
||||
ds = dict_st;
|
||||
ss = sub_st;
|
||||
if (sym_matches_type(dict_st, &PyFrozenDict_Type)) {
|
||||
REPLACE_OPCODE_IF_EVALUATES_PURE(dict_st, sub_st, res);
|
||||
}
|
||||
}
|
||||
|
||||
op(_BINARY_OP_SUBSCR_LIST_SLICE, (list_st, sub_st -- res, ls, ss)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue