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

arigo at codespeak.net arigo at codespeak.net
Fri Jul 24 14:16:44 CEST 2009


Author: arigo
Date: Fri Jul 24 14:16:42 2009
New Revision: 66576

Modified:
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py
   pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizeopt.py
Log:
Test and fix.


Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/optimizeopt.py	Fri Jul 24 14:16:42 2009
@@ -331,7 +331,7 @@
 
     def optimize_GUARD_VALUE(self, op):
         assert isinstance(op.args[1], Const)
-        assert op.args[0].getint() == op.args[1].getint()
+        assert op.args[0].get_() == op.args[1].get_()
         self.optimize_guard(op)
 
     def optimize_GUARD_TRUE(self, op):

Modified: pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizeopt.py
==============================================================================
--- pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizeopt.py	(original)
+++ pypy/branch/pyjitpl5-optimize4/pypy/jit/metainterp/test/test_optimizeopt.py	Fri Jul 24 14:16:42 2009
@@ -321,6 +321,17 @@
         """
         self.optimize_loop(ops, '', expected, i=8)
 
+    def test_constptr_guard_value(self):
+        ops = """
+        []
+        p1 = escape()
+        guard_value(p1, ConstPtr(myptr))
+            fail()
+        jump()
+        """
+        self.optimize_loop(ops, '', ops, p1=self.nodebox.value,
+                           boxkinds={'myptr': self.nodebox.value})
+
     # ----------
 
     def test_fold_guard_no_exception(self):



More information about the Pypy-commit mailing list