[pypy-svn] r13209 - pypy/dist/pypy/rpython

arigo at codespeak.net arigo at codespeak.net
Thu Jun 9 00:44:36 CEST 2005


Author: arigo
Date: Thu Jun  9 00:44:35 2005
New Revision: 13209

Modified:
   pypy/dist/pypy/rpython/rlist.py
Log:
setitem on lists.


Modified: pypy/dist/pypy/rpython/rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/rlist.py	(original)
+++ pypy/dist/pypy/rpython/rlist.py	Thu Jun  9 00:44:35 2005
@@ -74,6 +74,13 @@
             llfn = ll_getitem
         return hop.gendirectcall(llfn, v_lst, v_index)
 
+    def rtype_setitem((r_lst, r_int), hop):
+        v_lst, v_index, v_item = hop.inputargs(r_lst, Signed, r_lst.item_repr)
+        if hop.args_s[1].nonneg:
+            llfn = ll_setitem_nonneg
+        else:
+            llfn = ll_setitem
+        return hop.gendirectcall(llfn, v_lst, v_index, v_item)
 
 class __extend__(pairtype(ListRepr, ListRepr)):
     def convert_from_to((r_lst1, r_lst2), v, llops):



More information about the Pypy-commit mailing list