Esempio n. 1
0
 def gen_op(self, op):
     macro = 'OP_%s' % op.opname.upper()
     line = None
     if (op.opname.startswith('gc_') and op.opname
             not in ('gc_load_indexed', 'gc_store', 'gc_store_indexed')):
         meth = getattr(self.gcpolicy, macro, None)
         if meth:
             line = meth(self, op)
     else:
         meth = getattr(self, macro, None)
         if meth:
             line = meth(op)
     if line is None:
         lst = [self.expr(v) for v in op.args]
         lst.append(self.expr(op.result))
         line = '%s(%s);' % (macro, ', '.join(lst))
     if self.db.reverse_debugger:
         from rpython.translator.revdb import gencsupp
         if op.opname in gencsupp.set_revdb_protected:
             line = gencsupp.emit(line, self.lltypename(op.result),
                                  self.expr(op.result))
     if "\n" not in line:
         yield line
     else:
         for line in line.splitlines():
             yield line
Esempio n. 2
0
 def generic_get(self, op, sourceexpr, accessing_mem=True):
     T = self.lltypemap(op.result)
     newvalue = self.expr(op.result, special_case_void=False)
     result = '%s = %s;' % (newvalue, sourceexpr)
     if T is Void:
         result = '/* %s */' % result
     if self.db.reverse_debugger:
         S = self.lltypemap(op.args[0]).TO
         if (S._gckind != 'gc' and not S._hints.get('is_excdata')
                 and not S._hints.get('static_immutable')
                 and not S._hints.get('ignore_revdb') and accessing_mem):
             from rpython.translator.revdb import gencsupp
             result = gencsupp.emit(result, self.lltypename(op.result),
                                    newvalue)
     return result