Commits

Armin Rigo committed 236f4d2

Partial revert of 661d7f7624dc: don't let the JIT look inside rbigint.
It causes issues. Instead, fix the test more directly by adding some
@jit.elidable that were needed for consistency.

Comments (0)

Files changed (3)

pypy/module/pypyjit/policy.py

     def look_inside_function(self, func):
         mod = func.__module__ or '?'
 
-        if mod == 'rpython.rlib.rlocale' or mod == 'rpython.rlib.rsocket':
+        if mod == 'rpython.rlib.rbigint' or mod == 'rpython.rlib.rlocale' or mod == 'rpython.rlib.rsocket':
             return False
         if mod.startswith('pypy.interpreter.astcompiler.'):
             return False

pypy/module/pypyjit/test/test_policy.py

 
 def test_bigint():
     from rpython.rlib.rbigint import rbigint
-    assert pypypolicy.look_inside_function(rbigint.lt.im_func)
+    assert not pypypolicy.look_inside_function(rbigint.eq.im_func)
+    assert not pypypolicy.look_inside_function(rbigint.ne.im_func)
+    assert not pypypolicy.look_inside_function(rbigint.lt.im_func)
+    assert not pypypolicy.look_inside_function(rbigint.le.im_func)
+    assert not pypypolicy.look_inside_function(rbigint.gt.im_func)
+    assert not pypypolicy.look_inside_function(rbigint.ge.im_func)
 
 def test_rlocale():
     from rpython.rlib.rlocale import setlocale

rpython/rlib/rbigint.py

             i += 1
         return True
 
+    @jit.elidable
     def ne(self, other):
         return not self.eq(other)
 
             i -= 1
         return False
 
+    @jit.elidable
     def le(self, other):
         return not other.lt(self)
 
+    @jit.elidable
     def gt(self, other):
         return other.lt(self)
 
+    @jit.elidable
     def ge(self, other):
         return not self.lt(other)