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

arigo at codespeak.net arigo at codespeak.net
Wed Jul 29 19:25:30 CEST 2009


Author: arigo
Date: Wed Jul 29 19:25:28 2009
New Revision: 66677

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/optimizefindnode.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_optimizefindnode.py
Log:
Unskip the test and make it pass, with an explanation about
why not doing so would actually trigger a bug.


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/optimizefindnode.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/optimizefindnode.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/optimizefindnode.py	Wed Jul 29 19:25:28 2009
@@ -46,8 +46,7 @@
                     box.mark_escaped()
 
     def set_unique_nodes(self):
-        if (self.escaped or self.knownclsbox is None
-            # or self.fromstart, but this is implied by 'knownclsbox==None'
+        if (self.escaped or self.fromstart or self.knownclsbox is None
             or self.unique != UNIQUE_UNKNOWN):
             # this node is not suitable for being a virtual, or we
             # encounter it more than once when doing the recursion
@@ -101,7 +100,9 @@
         self.nodes[op.result] = instnode
 
     def find_nodes_GUARD_CLASS(self, op):
-        pass     # prevent default handling
+        instnode = self.getnode(op.args[0])
+        if instnode.fromstart:    # only useful in this case
+            instnode.knownclsbox = op.args[1]
 
     def find_nodes_SETFIELD_GC(self, op):
         instnode = self.getnode(op.args[0])

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_optimizefindnode.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_optimizefindnode.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_optimizefindnode.py	Wed Jul 29 19:25:28 2009
@@ -320,7 +320,6 @@
         self.find_nodes(ops, 'Not, Not')
 
     def test_find_nodes_new_mismatch(self):
-        py.test.skip("gives a Virtual instead of Not -- not really wrong")
         ops = """
         [p1]
         guard_class(p1, ConstClass(node_vtable))
@@ -328,6 +327,8 @@
         p2 = new_with_vtable(ConstClass(node_vtable2))
         jump(p2)
         """
+        # this must give 'Not', not 'Virtual', because optimizeopt.py would
+        # remove the guard_class for a virtual.
         self.find_nodes(ops, 'Not')
 
     def test_find_nodes_new_aliasing_mismatch(self):



More information about the Pypy-commit mailing list