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

antocuni at codespeak.net antocuni at codespeak.net
Thu Jul 30 12:26:55 CEST 2009


Author: antocuni
Date: Thu Jul 30 12:26:54 2009
New Revision: 66691

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/optimizefindnode.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/test/test_optimizefindnode.py
Log:
test and fixes for find_nodes of instanceof, subclassof, ooidentityhash


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	Thu Jul 30 12:26:54 2009
@@ -117,9 +117,9 @@
     find_nodes_OOIS        = find_nodes_no_escape
     find_nodes_OOISNOT     = find_nodes_no_escape
     find_nodes_ARRAYLEN_GC = find_nodes_no_escape
-    # XXX: OOIDENTITYHASH
-    # XXX: INSTANCEOF
-    # XXX: SUBCLASSOF
+    find_nodes_INSTANCEOF  = find_nodes_no_escape
+    find_nodes_OOIDENTITYHASH = find_nodes_no_escape
+    find_nodes_SUBCLASSOF  = find_nodes_no_escape
 
     def find_nodes_NEW_WITH_VTABLE(self, op):
         instnode = InstanceNode()

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	Thu Jul 30 12:26:54 2009
@@ -755,13 +755,22 @@
 
 class TestOOtype(BaseTestOptimizeFindNode, OOtypeMixin):
 
-    def test_find_nodes_instanceof(self):
-        py.test.skip('in-progress')
+    def test_find_nodes_oo_non_escape(self):
         ops = """
         [i0]
         p0 = new_with_vtable(ConstClass(node_vtable))
         i1 = instanceof(ConstClass(node_vtable), p0)
+        i2 = ooidentityhash(p0)
         jump(i1)
         """
         boxes, getnode = self.find_nodes(ops, 'Not')
         assert not getnode(boxes.p0).escaped
+
+    def test_find_nodes_subclassof(self):
+        ops = """
+        [p0]
+        i1 = subclassof(p0, p0)
+        jump(p0)
+        """
+        boxes, getnode = self.find_nodes(ops, 'Not')
+        assert not getnode(boxes.p0).escaped



More information about the Pypy-commit mailing list