示例#1
0
文件: gc.py 项目: weijiwei/pypy
 def malloc_big_fixedsize(size, tid):
     if self.DEBUG:
         self._random_usage_of_xmm_registers()
     type_id = llop.extract_ushort(llgroup.HALFWORD, tid)
     check_typeid(type_id)
     return llop1.do_malloc_fixedsize_clear(llmemory.GCREF, type_id,
                                            size, False, False, False)
示例#2
0
文件: gc.py 项目: weijiwei/pypy
 def _bh_malloc(self, sizedescr):
     from rpython.memory.gctypelayout import check_typeid
     llop1 = self.llop1
     type_id = llop.extract_ushort(llgroup.HALFWORD, sizedescr.tid)
     check_typeid(type_id)
     size = self.round_up_for_allocation(sizedescr.size)
     return llop1.do_malloc_fixedsize_clear(llmemory.GCREF, type_id, size,
                                            False, False, False)
示例#3
0
文件: gc.py 项目: mozillazg/pypy
 def _bh_malloc(self, sizedescr):
     from rpython.memory.gctypelayout import check_typeid
     llop1 = self.llop1
     type_id = llop.extract_ushort(llgroup.HALFWORD, sizedescr.tid)
     check_typeid(type_id)
     return llop1.do_malloc_fixedsize_clear(llmemory.GCREF,
                                            type_id, sizedescr.size,
                                            False, False, False)
示例#4
0
文件: gc.py 项目: mozillazg/pypy
 def malloc_big_fixedsize(size, tid):
     if self.DEBUG:
         self._random_usage_of_xmm_registers()
     type_id = llop.extract_ushort(llgroup.HALFWORD, tid)
     check_typeid(type_id)
     return llop1.do_malloc_fixedsize_clear(llmemory.GCREF,
                                            type_id, size,
                                            False, False, False)
示例#5
0
文件: gc.py 项目: weijiwei/pypy
 def _bh_malloc_array(self, num_elem, arraydescr):
     from rpython.memory.gctypelayout import check_typeid
     llop1 = self.llop1
     type_id = llop.extract_ushort(llgroup.HALFWORD, arraydescr.tid)
     check_typeid(type_id)
     return llop1.do_malloc_varsize_clear(llmemory.GCREF, type_id, num_elem,
                                          arraydescr.basesize,
                                          arraydescr.itemsize,
                                          arraydescr.lendescr.offset)
示例#6
0
文件: gc.py 项目: weijiwei/pypy
 def malloc_array_nonstandard(basesize, itemsize, lengthofs, tid,
                              num_elem):
     """For the rare case of non-standard arrays, i.e. arrays where
     self.standard_array_{basesize,length_ofs} is wrong.  It can
     occur e.g. with arrays of floats on Win32."""
     type_id = llop.extract_ushort(llgroup.HALFWORD, tid)
     check_typeid(type_id)
     return llop1.do_malloc_varsize_clear(llmemory.GCREF, type_id,
                                          num_elem, basesize, itemsize,
                                          lengthofs)
示例#7
0
文件: gc.py 项目: weijiwei/pypy
 def malloc_array(itemsize, tid, num_elem):
     """Allocate an array with a variable-size num_elem.
     Only works for standard arrays."""
     assert num_elem >= 0, 'num_elem should be >= 0'
     type_id = llop.extract_ushort(llgroup.HALFWORD, tid)
     check_typeid(type_id)
     return llop1.do_malloc_varsize_clear(
         llmemory.GCREF, type_id, num_elem,
         self.standard_array_basesize, itemsize,
         self.standard_array_length_ofs)
示例#8
0
文件: gc.py 项目: mozillazg/pypy
 def _bh_malloc_array(self, num_elem, arraydescr):
     from rpython.memory.gctypelayout import check_typeid
     llop1 = self.llop1
     type_id = llop.extract_ushort(llgroup.HALFWORD, arraydescr.tid)
     check_typeid(type_id)
     return llop1.do_malloc_varsize_clear(llmemory.GCREF,
                                          type_id, num_elem,
                                          arraydescr.basesize,
                                          arraydescr.itemsize,
                                          arraydescr.lendescr.offset)
示例#9
0
文件: gc.py 项目: mozillazg/pypy
 def malloc_array_nonstandard(basesize, itemsize, lengthofs, tid,
                              num_elem):
     """For the rare case of non-standard arrays, i.e. arrays where
     self.standard_array_{basesize,length_ofs} is wrong.  It can
     occur e.g. with arrays of floats on Win32."""
     type_id = llop.extract_ushort(llgroup.HALFWORD, tid)
     check_typeid(type_id)
     return llop1.do_malloc_varsize_clear(
         llmemory.GCREF,
         type_id, num_elem, basesize, itemsize, lengthofs)
示例#10
0
文件: gc.py 项目: mozillazg/pypy
 def malloc_array(itemsize, tid, num_elem):
     """Allocate an array with a variable-size num_elem.
     Only works for standard arrays."""
     assert num_elem >= 0, 'num_elem should be >= 0'
     type_id = llop.extract_ushort(llgroup.HALFWORD, tid)
     check_typeid(type_id)
     return llop1.do_malloc_varsize_clear(
         llmemory.GCREF,
         type_id, num_elem, self.standard_array_basesize, itemsize,
         self.standard_array_length_ofs)