|
76 | 76 | ) |
77 | 77 | from mypyc.irbuild.generator import gen_generator_func, gen_generator_func_body |
78 | 78 | from mypyc.irbuild.targets import AssignmentTarget |
79 | | -from mypyc.primitives.dict_ops import dict_get_method_with_none, dict_new_op, dict_set_item_op |
| 79 | +from mypyc.primitives.dict_ops import dict_get_method_with_none, dict_new_op, exact_dict_set_item_op |
80 | 80 | from mypyc.primitives.generic_ops import py_setattr_op |
81 | 81 | from mypyc.primitives.misc_ops import register_function |
82 | 82 | from mypyc.primitives.registry import builtin_names |
@@ -123,8 +123,8 @@ def transform_decorator(builder: IRBuilder, dec: Decorator) -> None: |
123 | 123 |
|
124 | 124 | if decorated_func is not None: |
125 | 125 | # Set the callable object representing the decorated function as a global. |
126 | | - builder.primitive_op( |
127 | | - dict_set_item_op, |
| 126 | + builder.call_c( |
| 127 | + exact_dict_set_item_op, |
128 | 128 | [builder.load_globals_dict(), builder.load_str(dec.func.name), decorated_func], |
129 | 129 | decorated_func.line, |
130 | 130 | ) |
@@ -826,7 +826,7 @@ def generate_singledispatch_dispatch_function( |
826 | 826 | find_impl = builder.load_module_attr_by_fullname("functools._find_impl", line) |
827 | 827 | registry = load_singledispatch_registry(builder, dispatch_func_obj, line) |
828 | 828 | uncached_impl = builder.py_call(find_impl, [arg_type, registry], line) |
829 | | - builder.primitive_op(dict_set_item_op, [dispatch_cache, arg_type, uncached_impl], line) |
| 829 | + builder.call_c(exact_dict_set_item_op, [dispatch_cache, arg_type, uncached_impl], line) |
830 | 830 | builder.assign(impl_to_use, uncached_impl, line) |
831 | 831 | builder.goto(call_func) |
832 | 832 |
|
@@ -1003,7 +1003,7 @@ def maybe_insert_into_registry_dict(builder: IRBuilder, fitem: FuncDef) -> None: |
1003 | 1003 | registry = load_singledispatch_registry(builder, dispatch_func_obj, line) |
1004 | 1004 | for typ in types: |
1005 | 1005 | loaded_type = load_type(builder, typ, None, line) |
1006 | | - builder.primitive_op(dict_set_item_op, [registry, loaded_type, to_insert], line) |
| 1006 | + builder.call_c(exact_dict_set_item_op, [registry, loaded_type, to_insert], line) |
1007 | 1007 | dispatch_cache = builder.builder.get_attr( |
1008 | 1008 | dispatch_func_obj, "dispatch_cache", dict_rprimitive, line |
1009 | 1009 | ) |
|
0 commit comments