Armin Rigo avatar Armin Rigo committed 3a1564f Merge

merge heads

Comments (0)

Files changed (2)

pypy/jit/backend/llsupport/llmodel.py

         ofs = arraydescr.lendescr.offset
         return rffi.cast(rffi.CArrayPtr(lltype.Signed), array)[ofs/WORD]
 
-    @specialize.argtype(2)
+    @specialize.argtype(1)
     def bh_getarrayitem_gc_i(self, gcref, itemindex, arraydescr):
         ofs, size, sign = self.unpack_arraydescr_size(arraydescr)
         # --- start of GC unsafe code (no GC operation!) ---
         # --- end of GC unsafe code ---
         return pval
 
-    @specialize.argtype(2)
+    @specialize.argtype(1)
     def bh_getarrayitem_gc_f(self, gcref, itemindex, arraydescr):
         ofs = self.unpack_arraydescr(arraydescr)
         # --- start of GC unsafe code (no GC operation!) ---
         # --- end of GC unsafe code ---
         return fval
 
-    @specialize.argtype(2)
+    @specialize.argtype(1)
     def bh_setarrayitem_gc_i(self, gcref, itemindex, newvalue, arraydescr):
         ofs, size, sign = self.unpack_arraydescr_size(arraydescr)
         # --- start of GC unsafe code (no GC operation!) ---
         items[itemindex] = self.cast_gcref_to_int(newvalue)
         # --- end of GC unsafe code ---
 
-    @specialize.argtype(2)
+    @specialize.argtype(1)
     def bh_setarrayitem_gc_f(self, gcref, itemindex, newvalue, arraydescr):
         ofs = self.unpack_arraydescr(arraydescr)
         # --- start of GC unsafe code (no GC operation!) ---
     return True
 has_gcflag_extra._subopnum = 1
 
-_gcflag_extras = []
+_gcflag_extras = set()
 
 def get_gcflag_extra(gcref):
     "NOT_RPYTHON"
     assert gcref   # not NULL!
-    return gcref in _gcflag_extras    # XXX slow
+    return gcref in _gcflag_extras
 get_gcflag_extra._subopnum = 2
 
 def toggle_gcflag_extra(gcref):
     "NOT_RPYTHON"
     assert gcref   # not NULL!
     try:
-        _gcflag_extras.remove(gcref)  # XXX slow
-    except ValueError:
-        _gcflag_extras.append(gcref)
+        _gcflag_extras.remove(gcref)
+    except KeyError:
+        _gcflag_extras.add(gcref)
 toggle_gcflag_extra._subopnum = 3
 
 def assert_no_more_gcflags():
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.