def record_dependencies(self): if not self.value: return eq = self.value._dict.key_eq hash = self.value._dict.key_hash self.comparer = EqualityComparer(self.db, self.value._TYPE._KEYTYPE, eq, hash) self.db.pending_node(self.comparer) super(CLICustomDictConst, self).record_dependencies()
def render(self, generator, op): DICT = op.args[0].value comparer = EqualityComparer(generator.db, DICT._KEYTYPE, (op.args[1], op.args[2], op.args[3]), (op.args[4], op.args[5], op.args[6])) generator.db.pending_node(comparer) dict_type = generator.cts.lltype_to_cts(DICT) generator.ilasm.new(comparer.get_ctor()) generator.ilasm.new('instance void %s::.ctor(class' '[mscorlib]System.Collections.Generic.IEqualityComparer`1<!0>)' % dict_type)
def render(self, generator, op): DICT = op.args[0].value comparer = EqualityComparer(generator.db, DICT._KEYTYPE, (op.args[1], op.args[2], op.args[3]), (op.args[4], op.args[5], op.args[6])) generator.db.pending_node(comparer) dict_type = generator.cts.lltype_to_cts(DICT) generator.ilasm.new(comparer.get_ctor()) generator.ilasm.new( 'instance void %s::.ctor(class' '[mscorlib]System.Collections.Generic.IEqualityComparer`1<!0>)' % dict_type)
class CLICustomDictConst(CLIDictMixin, CustomDictConst): def record_dependencies(self): if not self.value: return eq = self.value._dict.key_eq hash = self.value._dict.key_hash self.comparer = EqualityComparer(self.db, self.value._TYPE._KEYTYPE, eq, hash) self.db.pending_node(self.comparer) super(CLICustomDictConst, self).record_dependencies() def create_pointer(self, gen): assert not self.is_null() gen.ilasm.new(self.comparer.get_ctor()) class_name = self.get_type() gen.ilasm.new('instance void %s::.ctor(class ' '[mscorlib]System.Collections.Generic.IEqualityComparer`1<!0>)' % class_name) self.db.const_count.inc('CustomDict') self.db.const_count.inc('CustomDict', self.value._TYPE._KEYTYPE, self.value._TYPE._VALUETYPE)
class CLICustomDictConst(CLIDictMixin, CustomDictConst): def record_dependencies(self): if not self.value: return eq = self.value._dict.key_eq hash = self.value._dict.key_hash self.comparer = EqualityComparer(self.db, self.value._TYPE._KEYTYPE, eq, hash) self.db.pending_node(self.comparer) super(CLICustomDictConst, self).record_dependencies() def create_pointer(self, gen): assert not self.is_null() gen.ilasm.new(self.comparer.get_ctor()) class_name = self.get_type() gen.ilasm.new( 'instance void %s::.ctor(class ' '[mscorlib]System.Collections.Generic.IEqualityComparer`1<!0>)' % class_name) self.db.const_count.inc('CustomDict') self.db.const_count.inc('CustomDict', self.value._TYPE._KEYTYPE, self.value._TYPE._VALUETYPE)