gh-146558: JIT optimize dict access for objects with known hash (#146559)

This commit is contained in:
Kumar Aditya 2026-03-30 19:53:29 +05:30 committed by GitHub
parent 76c554bcdf
commit 8e9d21c64b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1558 additions and 1257 deletions

View file

@ -165,6 +165,11 @@ dummy_func(void) {
}
op(_STORE_SUBSCR_DICT, (value, dict_st, sub -- st)) {
PyObject *sub_o = sym_get_const(ctx, sub);
if (sub_o != NULL) {
optimize_dict_known_hash(ctx, dependencies, this_instr,
sub_o, _STORE_SUBSCR_DICT_KNOWN_HASH);
}
(void)value;
st = dict_st;
}
@ -482,6 +487,11 @@ dummy_func(void) {
}
op(_BINARY_OP_SUBSCR_DICT, (dict_st, sub_st -- res, ds, ss)) {
PyObject *sub = sym_get_const(ctx, sub_st);
if (sub != NULL) {
optimize_dict_known_hash(ctx, dependencies, this_instr,
sub, _BINARY_OP_SUBSCR_DICT_KNOWN_HASH);
}
res = sym_new_not_null(ctx);
ds = dict_st;
ss = sub_st;