[pypy-svn] r66455 - in pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp: . test

arigo at codespeak.net arigo at codespeak.net
Mon Jul 20 20:05:15 CEST 2009


Author: arigo
Date: Mon Jul 20 20:05:14 2009
New Revision: 66455

Modified:
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizefindnode.py
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizefindnode.py
Log:
Fix test_find_nodes_default_field, with a comment about why
the previous answer was wrong after all.


Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizefindnode.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizefindnode.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizefindnode.py	Mon Jul 20 20:05:14 2009
@@ -193,6 +193,13 @@
         #
         fields = []
         d = exitnode.curfields
+        if inputnode.origfields is not None:
+            if d is not None:
+                d = d.copy()
+            else:
+                d = av_newdict()
+            for ofs in inputnode.origfields:
+                d.setdefault(ofs, self.node_escaped)
         if d is not None:
             lst = d.keys()
             sort_descrs(lst)

Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizefindnode.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizefindnode.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizefindnode.py	Mon Jul 20 20:05:14 2009
@@ -424,9 +424,9 @@
         # the field 'value' has its default value of 0
         jump(p1)
         """
-        # Unclear if the answer must contain or not the 'value' field.
-        # For now it does not.
-        self.find_nodes(ops, 'Virtual(node_vtable)')
+        # The answer must contain the 'value' field, because otherwise
+        # we might get incorrect results: when tracing, maybe i0 was not 0.
+        self.find_nodes(ops, 'Virtual(node_vtable, valuedescr=Not)')
 
     # ------------------------------
     # Bridge tests



More information about the Pypy-commit mailing list