[pypy-svn] r68497 - pypy/branch/prevent-silly-unrolling/pypy/jit/metainterp/test

pedronis at codespeak.net pedronis at codespeak.net
Thu Oct 15 16:31:28 CEST 2009


Author: pedronis
Date: Thu Oct 15 16:31:27 2009
New Revision: 68497

Modified:
   pypy/branch/prevent-silly-unrolling/pypy/jit/metainterp/test/test_basic.py
Log:
(cfbolz, pedronis): no need to use a custom policy for this


Modified: pypy/branch/prevent-silly-unrolling/pypy/jit/metainterp/test/test_basic.py
==============================================================================
--- pypy/branch/prevent-silly-unrolling/pypy/jit/metainterp/test/test_basic.py	(original)
+++ pypy/branch/prevent-silly-unrolling/pypy/jit/metainterp/test/test_basic.py	Thu Oct 15 16:31:27 2009
@@ -949,14 +949,6 @@
         assert res == 456 * 2
 
     def test_residual_external_call(self):
-        class CustomPolicy(JitPolicy):
-            def look_inside_function(self, func):
-                mod = func.__module__ or '?'
-                if mod == 'pypy.rpython.lltypesystem.module.ll_math':
-                    # XXX temporary, contains force_cast
-                    return False
-                return super(CustomPolicy, self).look_inside_function(func)
-
         import math
         myjitdriver = JitDriver(greens = [], reds = ['x', 'y', 'res'])
         def f(x, y):
@@ -965,13 +957,15 @@
             while y > 0:
                 myjitdriver.can_enter_jit(x=x, y=y, res=res)
                 myjitdriver.jit_merge_point(x=x, y=y, res=res)
+                # this is an external call that the default policy ignores
                 rpart, ipart = math.modf(x)
                 res += ipart
                 y -= 1
             return res
-        res = self.meta_interp(f, [6, 7], policy=CustomPolicy())
+        res = self.meta_interp(f, [6, 7])
         assert res == 42
         self.check_loop_count(1)
+        self.check_loops(call=1)
 
 
 class TestOOtype(BasicTests, OOJitMixin):



More information about the Pypy-commit mailing list