Author: Armin Rigo <[email protected]>
Branch:
Changeset: r64793:236f4d2c1567
Date: 2013-06-05 13:35 +0200
http://bitbucket.org/pypy/pypy/changeset/236f4d2c1567/
Log: 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.
diff --git a/pypy/module/pypyjit/policy.py b/pypy/module/pypyjit/policy.py
--- a/pypy/module/pypyjit/policy.py
+++ b/pypy/module/pypyjit/policy.py
@@ -118,7 +118,7 @@
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
diff --git a/pypy/module/pypyjit/test/test_policy.py
b/pypy/module/pypyjit/test/test_policy.py
--- a/pypy/module/pypyjit/test/test_policy.py
+++ b/pypy/module/pypyjit/test/test_policy.py
@@ -8,7 +8,12 @@
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
diff --git a/rpython/rlib/rbigint.py b/rpython/rlib/rbigint.py
--- a/rpython/rlib/rbigint.py
+++ b/rpython/rlib/rbigint.py
@@ -448,6 +448,7 @@
i += 1
return True
+ @jit.elidable
def ne(self, other):
return not self.eq(other)
@@ -486,12 +487,15 @@
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)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit