Antonio Cuni avatar Antonio Cuni committed fea15c6

now we can implement unpack_arraydescr_size for real

Comments (0)

Files changed (1)

pypy/jit/backend/llgraph/runner.py

             return self.bh_raw_load_i(struct, offset, descr)
 
     def unpack_arraydescr_size(self, arraydescr):
-        # so far this is used only by optimizeopt.virtualize for
-        # {GET,SET}ARRAYITEM_RAW: for now we just return dummy values for
-        # basesize and is_signed
-        assert isinstance(arraydescr, Descr)
-        XXX # ???
-        return 0, arraydescr.width, True
+        from pypy.jit.backend.llsupport.symbolic import get_array_token
+        from pypy.jit.backend.llsupport.descr import get_type_flag, FLAG_SIGNED
+        assert isinstance(arraydescr, ArrayDescr)
+        basesize, itemsize, _ = get_array_token(arraydescr.A, False)
+        flag = get_type_flag(arraydescr.A.OF)
+        is_signed = (flag == FLAG_SIGNED)
+        return basesize, itemsize, is_signed
 
     def bh_raw_store_i(self, struct, offset, newvalue, descr):
         ll_p = rffi.cast(rffi.CCHARP, struct)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.