[pypy-svn] r22657 - in pypy/dist/pypy: jit rpython

ac at codespeak.net ac at codespeak.net
Wed Jan 25 17:10:15 CET 2006


Author: ac
Date: Wed Jan 25 17:10:14 2006
New Revision: 22657

Modified:
   pypy/dist/pypy/jit/llabstractinterp.py
   pypy/dist/pypy/jit/llcontainer.py
   pypy/dist/pypy/rpython/rgenop.py
   pypy/dist/pypy/rpython/rlist.py
Log:
(samuele, arre) remove the addconst hack.

Modified: pypy/dist/pypy/jit/llabstractinterp.py
==============================================================================
--- pypy/dist/pypy/jit/llabstractinterp.py	(original)
+++ pypy/dist/pypy/jit/llabstractinterp.py	Wed Jan 25 17:10:14 2006
@@ -532,9 +532,6 @@
     def genconst(self, llvalue):
         return rgenop.genconst(self.newblock, llvalue)
     
-    def addconst(self, const):
-        return rgenop.addconst(self.newblock, const)
-    
     def binding(self, v):
         if isinstance(v, Constant):
             return LLAbstractValue(v)

Modified: pypy/dist/pypy/jit/llcontainer.py
==============================================================================
--- pypy/dist/pypy/jit/llcontainer.py	(original)
+++ pypy/dist/pypy/jit/llcontainer.py	Wed Jan 25 17:10:14 2006
@@ -52,17 +52,16 @@
     def build_runtime_container(self, builder):
         RESULT_TYPE = lltype.Ptr(self.T)
         if self.a_parent is not None:
+            parentindex = const(self.parentindex, lltype.Void)
             v_parent = self.a_parent.forcevarorconst(builder)
-            parentindex = builder.addconst(const(self.parentindex,
-                                                 lltype.Void))
             v_result = builder.genop('getsubstruct',
-                                     [v_parent,parentindex], RESULT_TYPE)
+                                     [v_parent, parentindex], RESULT_TYPE)
         else:
-            t = builder.addconst(const(self.T, lltype.Void))
+            t = const(self.T, lltype.Void)
             if self.T._is_varsize():
-
                 v_result = builder.genop('malloc_varsize',
-                                         [t, builder.genconst(self.length)],
+                                         [t,
+                                          builder.genconst(self.length)],
                                          RESULT_TYPE)
             else:
                 v_result = builder.genop('malloc', [t], RESULT_TYPE)
@@ -77,9 +76,8 @@
                 T = self.fieldtype(name)
                 if isinstance(T, lltype.ContainerType):
                     # initialize the substructure/subarray
-                    c_name = builder.addconst(const(name, lltype.Void))
                     v_subptr = builder.genop('getsubstruct',
-                                             [v_target, c_name],
+                                             [v_target, const(name, lltype.Void)],
                                              lltype.Ptr(T))
                     assert isinstance(a_value.content, LLVirtualContainer)
                     a_value.content.buildcontent(builder, v_subptr)
@@ -161,8 +159,7 @@
         return getattr(self.T, name)
 
     def setop(self, builder, v_target, name, v_value):
-        c_name = builder.addconst(const(name, lltype.Void))
-        builder.genop('setfield', [v_target, c_name, v_value],
+        builder.genop('setfield', [v_target, const(name, lltype.Void), v_value],
                       lltype.Void)
 
 

Modified: pypy/dist/pypy/rpython/rgenop.py
==============================================================================
--- pypy/dist/pypy/rpython/rgenop.py	(original)
+++ pypy/dist/pypy/rpython/rgenop.py	Wed Jan 25 17:10:14 2006
@@ -38,10 +38,6 @@
     v.concretetype = lltype.typeOf(llvalue)
     return v
 
-def addconst(block, const):
-    assert isinstance(const, flowmodel.Constant)
-    return const
-
 def closeblock1(block):
     link = flowmodel.Link([], None)
     block.closeblock(link)

Modified: pypy/dist/pypy/rpython/rlist.py
==============================================================================
--- pypy/dist/pypy/rpython/rlist.py	(original)
+++ pypy/dist/pypy/rpython/rlist.py	Wed Jan 25 17:10:14 2006
@@ -180,18 +180,16 @@
     def build(self, builder, items_v):
         """Make the operations that would build a list containing the
         provided items."""
-        c_list = builder.addconst(self.c_LIST)
         c_newlist = builder.genconst(self.newlist_ptr)
         c_len  = builder.genconst(len(items_v))
         v_result = builder.genop('direct_call',
-                                 [c_newlist, c_list, c_len],
+                                 [c_newlist, self.c_LIST, c_len],
                                  self.LISTPTR)
         c_setitem_nonneg = builder.genconst(self.setitem_nonneg_ptr)
-        c_dum_nocheck = builder.addconst(self.c_dum_nocheck)
         for i, v in enumerate(items_v):
             c_i = builder.genconst(i)
             builder.genop('direct_call', [c_setitem_nonneg,
-                                          c_dum_nocheck,
+                                          self.c_dum_nocheck,
                                           v_result, c_i, v],
                           Void)
         return v_result



More information about the Pypy-commit mailing list