[pypy-svn] r61926 - pypy/branch/pyjitpl5/pypy/jit/metainterp

fijal at codespeak.net fijal at codespeak.net
Sun Feb 15 12:58:31 CET 2009


Author: fijal
Date: Sun Feb 15 12:58:30 2009
New Revision: 61926

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/optimize.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
Log:
A proper fix


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/optimize.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/optimize.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/optimize.py	Sun Feb 15 12:58:30 2009
@@ -606,11 +606,7 @@
                 assert isinstance(instnode.cls.source, ListDescr)
                 if not instnode.escaped:
                     instnode.virtual = True
-                    if len(op.args) > 2:
-                        valuesource = self.getsource(op.args[2])
-                    else:
-                        # XXX check for type
-                        valuesource = ConstInt(0)
+                    valuesource = self.getsource(op.args[2])
                     assert isinstance(valuesource, Const)
                     for i in range(instnode.known_length):
                         instnode.curfields[i] = InstanceNode(valuesource,

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	Sun Feb 15 12:58:30 2009
@@ -399,6 +399,11 @@
     @arguments("builtin", "varargs")
     def opimpl_newlist(self, descr, varargs):
         args = [descr.malloc_func] + varargs
+        if len(varargs) == 1:
+            if descr.tp == "int":
+                args.append(ConstInt(0))
+            else:
+                args.append(ConstPtr(lltype.nullptr(llmemory.GCREF.TO)))
         op = self.execute_with_exc('newlist', args, 'ptr')
 
     @arguments("indirectcallset", "box", "varargs")



More information about the Pypy-commit mailing list