Beispiel #1
0
 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 = []
Beispiel #2
0
 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 = []
 def __init__(self):
     GcCache.__init__(self, False)
     # create a nursery
     NTP = rffi.CArray(lltype.Signed)
     self.nursery = lltype.malloc(NTP, 16, flavor='raw')
     self.addrs = lltype.malloc(rffi.CArray(lltype.Signed), 3,
                                flavor='raw')
     self.addrs[0] = rffi.cast(lltype.Signed, self.nursery)
     self.addrs[1] = self.addrs[0] + 16*WORD
     self.addrs[2] = 0
     # 16 WORDs
     def malloc_slowpath(size):
         assert size == self.expected_malloc_slowpath_size
         nadr = rffi.cast(lltype.Signed, self.nursery)
         self.addrs[0] = nadr + size
         self.addrs[2] += 1
         return nadr
     self.malloc_slowpath = malloc_slowpath
     self.MALLOC_SLOWPATH = lltype.FuncType([lltype.Signed],
                                            lltype.Signed)
     self._counter = 123000
Beispiel #4
0
 def __init__(self):
     GcCache.__init__(self, False)
     # create a nursery
     NTP = rffi.CArray(lltype.Signed)
     self.nursery = lltype.malloc(NTP, 16, flavor='raw')
     self.addrs = lltype.malloc(rffi.CArray(lltype.Signed), 2,
                                flavor='raw')
     self.addrs[0] = rffi.cast(lltype.Signed, self.nursery)
     self.addrs[1] = self.addrs[0] + 64
     # 64 bytes
     def malloc_slowpath(size):
         from pypy.rlib.rarithmetic import r_ulonglong
         assert size == 8
         nadr = rffi.cast(lltype.Signed, self.nursery)
         self.addrs[0] = 99999    # should be overridden by the caller
         return ((r_ulonglong(nadr + size) << 32) |     # this part in edx
                  r_ulonglong(nadr))                    # this part in eax
     self.malloc_slowpath = malloc_slowpath
     self.MALLOC_SLOWPATH = lltype.FuncType([lltype.Signed],
                                            lltype.UnsignedLongLong)
     self._counter = 123
Beispiel #5
0
    def __init__(self):
        GcCache.__init__(self, False)
        # create a nursery
        NTP = rffi.CArray(lltype.Signed)
        self.nursery = lltype.malloc(NTP, 16, flavor='raw')
        self.addrs = lltype.malloc(rffi.CArray(lltype.Signed), 2, flavor='raw')
        self.addrs[0] = rffi.cast(lltype.Signed, self.nursery)
        self.addrs[1] = self.addrs[0] + 64

        # 64 bytes
        def malloc_slowpath(size):
            from pypy.rlib.rarithmetic import r_ulonglong
            assert size == 8
            nadr = rffi.cast(lltype.Signed, self.nursery)
            self.addrs[0] = 99999  # should be overridden by the caller
            return ((r_ulonglong(nadr + size) << 32) |  # this part in edx
                    r_ulonglong(nadr))  # this part in eax

        self.malloc_slowpath = malloc_slowpath
        self.MALLOC_SLOWPATH = lltype.FuncType([lltype.Signed],
                                               lltype.UnsignedLongLong)
        self._counter = 123
Beispiel #6
0
 def __init__(self, gcdescr, translator=None, rtyper=None):
     GcCache.__init__(self, translator is not None, rtyper)
     self.gcdescr = gcdescr
Beispiel #7
0
 def __init__(self, gcdescr, translator=None):
     GcCache.__init__(self, translator is not None)
     self.gcdescr = gcdescr