Commits

Maciej Fijalkowski committed 7a3a9c9

fix the test on x86

Comments (0)

Files changed (2)

pypy/jit/backend/llsupport/llmodel.py

                  gcdescr=None):
         assert type(opts) is not bool
         self.opts = opts
+        self.arraydescr_cache = {}
 
         from pypy.jit.backend.llsupport.gc import get_ll_description
         AbstractCPU.__init__(self)
                                                  extrainfo, ffi_flags)
 
     def copy_and_change_descr_typeinfo_to_ptr(self, descr):
-        return ArrayDescr(descr.basesize, descr.itemsize, descr.lendescr, FLAG_POINTER)
+        key = (descr.basesize, descr.itemsize, descr.lendescr)
+        try:
+            return self.arraydescr_cache[key]
+        except KeyError:
+            new_descr = ArrayDescr(descr.basesize, descr.itemsize,
+                                   descr.lendescr, FLAG_POINTER)
+            self.arraydescr_cache[key] = new_descr
+            return new_descr
 
     def get_overflow_error(self):
         ovf_vtable = self.cast_adr_to_int(self._ovf_error_vtable)

pypy/jit/codewriter/jtransform.py

-import copy
 
 import py