[pypy-commit] pypy core-only-tracing: (antocuni, arigo, romain around): try to implement a reasonable is_core_function policy for the pypy interpreter
antocuni
noreply at buildbot.pypy.org
Fri Jan 20 15:35:25 CET 2012
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: core-only-tracing
Changeset: r51538:c19f30c468d8
Date: 2012-01-20 15:34 +0100
http://bitbucket.org/pypy/pypy/changeset/c19f30c468d8/
Log: (antocuni, arigo, romain around): try to implement a reasonable
is_core_function policy for the pypy interpreter
diff --git a/pypy/jit/codewriter/policy.py b/pypy/jit/codewriter/policy.py
--- a/pypy/jit/codewriter/policy.py
+++ b/pypy/jit/codewriter/policy.py
@@ -39,6 +39,14 @@
return True # look into everything by default
def is_core_graph(self, graph):
+ try:
+ func = graph.func
+ except AttributeError:
+ return True
+ else:
+ return self.is_core_function(func)
+
+ def is_core_function(self, func):
return True
def _reject_function(self, func):
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
@@ -150,3 +150,8 @@
return False
return True
+
+ def is_core_function(self, func):
+ mod = func.__module__ or '?'
+ is_interpreter = mod.startswith('pypy.interpreter.')
+ return is_interpreter or mod.startswith('pypy.module.pypyjit.')
More information about the pypy-commit
mailing list