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

antocuni at codespeak.net antocuni at codespeak.net
Sat May 23 19:10:29 CEST 2009


Author: antocuni
Date: Sat May 23 19:10:29 2009
New Revision: 65368

Modified:
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py
   pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py
Log:
implement guard_value, test passes



Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/optimize3.py	Sat May 23 19:10:29 2009
@@ -175,15 +175,15 @@
         node.cls = InstanceNode(op.args[1], const=True)
         return self.optimize_guard(spec, op)
 
-##     def guard_value(self, spec, op):
-##         instnode = spec.nodes[op.args[0]]
-##         assert isinstance(op.args[1], Const)
-##         if instnode.const:
-##             return
-##         self.optimize_guard(spec, op)
-##         instnode.const = True
-##         instnode.source = op.args[0].constbox()
-##         return op
+    def guard_value(self, spec, op):
+        instnode = spec.nodes[op.args[0]]
+        assert isinstance(op.args[1], Const)
+        if instnode.const:
+            return
+        self.optimize_guard(spec, op)
+        instnode.const = True
+        instnode.source = op.args[0].constbox()
+        return op
 
 ##     def guard_nonvirtualized(self, spec, op):
 ##         return

Modified: pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py
==============================================================================
--- pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py	(original)
+++ pypy/branch/pyjitpl5-experiments/pypy/jit/metainterp/test/test_optimize3.py	Sat May 23 19:10:29 2009
@@ -93,7 +93,6 @@
         assert len(loop.operations) == 1
 
     def test_remove_consecutive_guard_value_constfold(self):
-        py.test.skip('in-progress')
         n = BoxInt(0)
         n1 = BoxInt(1)
         n2 = BoxInt(3)



More information about the Pypy-commit mailing list