Exemplo n.º 1
0
 def generate_function(self, funcname, func, ARGS, RESULT=llmemory.GCREF):
     """Generates a variant of malloc with the given name and the given
     arguments.  It should return NULL if out of memory.  If it raises
     anything, it must be an optional MemoryError.
     """
     FUNCPTR = lltype.Ptr(lltype.FuncType(ARGS, RESULT))
     descr = get_call_descr(self, ARGS, RESULT)
     setattr(self, funcname, func)
     setattr(self, funcname + '_FUNCPTR', FUNCPTR)
     setattr(self, funcname + '_descr', descr)
     self._generated_functions.append(funcname)
Exemplo n.º 2
0
Arquivo: gc.py Projeto: weijiwei/pypy
 def generate_function(self, funcname, func, ARGS, RESULT=llmemory.GCREF):
     """Generates a variant of malloc with the given name and the given
     arguments.  It should return NULL if out of memory.  If it raises
     anything, it must be an optional MemoryError.
     """
     FUNCPTR = lltype.Ptr(lltype.FuncType(ARGS, RESULT))
     descr = get_call_descr(self, ARGS, RESULT)
     setattr(self, funcname, func)
     setattr(self, funcname + '_FUNCPTR', FUNCPTR)
     setattr(self, funcname + '_descr', descr)
     self._generated_functions.append(funcname)
Exemplo n.º 3
0
 def generate_function(self, funcname, func, ARGS, RESULT=llmemory.GCREF):
     """Generates a variant of malloc with the given name and the given
     arguments.  It should return NULL if out of memory.  If it raises
     anything, it must be an optional MemoryError.
     """
     FUNCPTR = lltype.Ptr(lltype.FuncType(ARGS, RESULT))
     # Note: the call may invoke the GC, which may run finalizers.
     # Finalizers are constrained in what they can do, but we can't
     # really express that in a useful way here.
     descr = get_call_descr(self, ARGS, RESULT, EffectInfo.MOST_GENERAL)
     setattr(self, funcname, func)
     setattr(self, funcname + '_FUNCPTR', FUNCPTR)
     setattr(self, funcname + '_descr', descr)
     self._generated_functions.append(funcname)
Exemplo n.º 4
0
Arquivo: gc.py Projeto: mozillazg/pypy
 def generate_function(self, funcname, func, ARGS, RESULT=llmemory.GCREF):
     """Generates a variant of malloc with the given name and the given
     arguments.  It should return NULL if out of memory.  If it raises
     anything, it must be an optional MemoryError.
     """
     FUNCPTR = lltype.Ptr(lltype.FuncType(ARGS, RESULT))
     # Note: the call may invoke the GC, which may run finalizers.
     # Finalizers are constrained in what they can do, but we can't
     # really express that in a useful way here.
     descr = get_call_descr(self, ARGS, RESULT, EffectInfo.MOST_GENERAL)
     setattr(self, funcname, func)
     setattr(self, funcname + '_FUNCPTR', FUNCPTR)
     setattr(self, funcname + '_descr', descr)
     self._generated_functions.append(funcname)
Exemplo n.º 5
0
Arquivo: gc.py Projeto: xen0n/pypy
 def __init__(self, gcdescr, translator=None, rtyper=None):
     GcCache.__init__(self, translator is not None, rtyper)
     self.gcdescr = gcdescr
     if translator and translator.config.translation.gcremovetypeptr:
         self.fielddescr_vtable = None
     else:
         self.fielddescr_vtable = get_field_descr(self, rclass.OBJECT,
                                                  'typeptr')
     self._generated_functions = []
     self.memcpy_fn = memcpy_fn
     self.memcpy_descr = get_call_descr(self,
         [lltype.Signed, lltype.Signed, lltype.Signed], lltype.Void,
         EffectInfo([], [], [], [], [], [], EffectInfo.EF_CANNOT_RAISE,
             can_collect=False))
Exemplo n.º 6
0
Arquivo: llmodel.py Projeto: Mu-L/pypy
 def calldescrof(self, FUNC, ARGS, RESULT, extrainfo):
     return get_call_descr(self.gc_ll_descr, ARGS, RESULT, extrainfo)
Exemplo n.º 7
0
 def calldescrof(self, FUNC, ARGS, RESULT, extrainfo):
     return get_call_descr(self.gc_ll_descr, ARGS, RESULT, extrainfo)