Source

pypy / pypy / rpython / ootypesystem / rlist.py

Diff from to

pypy/rpython/ootypesystem/rlist.py

         else:
             return ootype.List()
 
-    def _generate_newlist(self, llops, items_v):
+    def _generate_newlist(self, llops, items_v, v_sizehint):
         c_list = inputconst(ootype.Void, self.lowleveltype)
         v_result = llops.genop("new", [c_list], resulttype=self.lowleveltype)
         c_resize = inputconst(ootype.Void, "_ll_resize")
 
 
 
-def newlist(llops, r_list, items_v):
-    v_result = r_list._generate_newlist(llops, items_v)
+def newlist(llops, r_list, items_v, v_sizehint=None):
+    v_result = r_list._generate_newlist(llops, items_v, v_sizehint)
 
     c_setitem = inputconst(ootype.Void, "ll_setitem_fast")
     for i, v_item in enumerate(items_v):
     def make_iterator_repr(self):
         return ListIteratorRepr(self)
 
-    def _generate_newlist(self, llops, items_v):
+    def _generate_newlist(self, llops, items_v, v_sizehint):
         c_array = inputconst(ootype.Void, self.lowleveltype)
         c_length = inputconst(ootype.Signed, len(items_v))
         v_result = llops.genop("oonewarray", [c_array, c_length], resulttype=self.lowleveltype)
                 {"iterable": r_list.lowleveltype, "index": ootype.Signed})
         self.ll_listiter = ll_listiter
         self.ll_listnext = ll_listnext
+        self.ll_getnextindex = ll_getnextindex
 
 
 def ll_listiter(ITER, lst):
     iter.index = index + 1
     return l.ll_getitem_fast(index)
 
+def ll_getnextindex(iter):
+    return iter.index