Author: Carl Friedrich Bolz <[email protected]>
Branch: 
Changeset: r70441:e16936f60a43
Date: 2014-04-04 18:01 +0200
http://bitbucket.org/pypy/pypy/changeset/e16936f60a43/

Log:    test and fix: NonNull is not more general than NULL (!!!) fixes the
        test, but another bug is still around

diff --git a/rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py 
b/rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py
--- a/rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py
+++ b/rpython/jit/metainterp/optimizeopt/test/test_virtualstate.py
@@ -89,6 +89,11 @@
         assert isgeneral(OptValue(ConstPtr(fooref)),
                          OptValue(ConstPtr(fooref)))
 
+        value1 = OptValue(BoxPtr())
+        value1.make_nonnull(None)
+        value2 = OptValue(ConstPtr(LLtypeMixin.nullptr))
+        assert not isgeneral(value1, value2)
+
     def test_field_matching_generalization(self):
         const1 = NotVirtualStateInfo(OptValue(ConstInt(1)))
         const2 = NotVirtualStateInfo(OptValue(ConstInt(2)))
diff --git a/rpython/jit/metainterp/optimizeopt/virtualstate.py 
b/rpython/jit/metainterp/optimizeopt/virtualstate.py
--- a/rpython/jit/metainterp/optimizeopt/virtualstate.py
+++ b/rpython/jit/metainterp/optimizeopt/virtualstate.py
@@ -269,6 +269,10 @@
         elif self.level == LEVEL_KNOWNCLASS:
             if not self.known_class.same_constant(other.known_class):
                 return False
+        elif self.level == LEVEL_NONNULL:
+            if other.constbox and not other.constbox.nonnull():
+                return False
+
         if not self.intbound.contains_bound(other.intbound):
             return False
         if self.lenbound and other.lenbound:
diff --git a/rpython/jit/metainterp/test/test_loop.py 
b/rpython/jit/metainterp/test/test_loop.py
--- a/rpython/jit/metainterp/test/test_loop.py
+++ b/rpython/jit/metainterp/test/test_loop.py
@@ -502,7 +502,6 @@
         assert self.meta_interp(h, [25]) == 7 * 25 * (7 + 8 + 2 + 3)
 
     def test_two_bridged_loops_classes(self):
-        py.test.skip("fix me :-((((")
         myjitdriver = JitDriver(greens = ['pos'], reds = ['i', 'n', 'x', 's'])
         class A(object):
             pass
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to