[pypy-svn] pypy jit-virtual_state: better nonnull test

hakanardo commits-noreply at bitbucket.org
Sun Feb 6 17:18:07 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-virtual_state
Changeset: r41657:31774cca9d1f
Date: 2011-02-06 15:06 +0100
http://bitbucket.org/pypy/pypy/changeset/31774cca9d1f/

Log:	better nonnull test

diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py
--- a/pypy/jit/metainterp/optimizeopt/unroll.py
+++ b/pypy/jit/metainterp/optimizeopt/unroll.py
@@ -212,7 +212,7 @@
         if not isinstance(other, NotVirtualInfo):
             raise InvalidLoop
         if self.level == LEVEL_KNOWNCLASS and \
-           box.value and \
+           box.nonnull() and \
            self.known_class.same_constant(cpu.ts.cls_of_box(box)):
             # Note: This is only a hint on what the class of box was
             # during the trace. There are actually no guarentees that this

diff --git a/pypy/jit/metainterp/test/test_optimizebasic.py b/pypy/jit/metainterp/test/test_optimizebasic.py
--- a/pypy/jit/metainterp/test/test_optimizebasic.py
+++ b/pypy/jit/metainterp/test/test_optimizebasic.py
@@ -3352,6 +3352,8 @@
         [i0]
         i1 = int_lt(i0, 4)
         guard_true(i1) []
+        i1p = int_gt(i0, -4)
+        guard_true(i1p) []        
         i2 = int_sub(i0, 10)
         i3 = int_lt(i2, -5)
         guard_true(i3) []
@@ -3361,6 +3363,8 @@
         [i0]
         i1 = int_lt(i0, 4)
         guard_true(i1) []
+        i1p = int_gt(i0, -4)
+        guard_true(i1p) []        
         i2 = int_sub(i0, 10)
         jump(i0)
         """


More information about the Pypy-commit mailing list