Author: Maciej Fijalkowski <fij...@gmail.com>
Branch: better-jit-hooks
Changeset: r49833:84c2db217151
Date: 2011-11-26 20:46 +0200
http://bitbucket.org/pypy/pypy/changeset/84c2db217151/

Log:    a branch to experiment with some better JIT hooks

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
@@ -84,6 +84,14 @@
             raise ValueError("access_directly on a function which we don't see 
%s" % graph)
         return res
 
+    def get_jit_portal(self):
+        """ Returns a None or an instance of pypy.rlib.jit.JitPortal
+        The portal methods are called for various special cases in the JIT
+        as a mean to give feedback to the user. Read JitPortal's docstring
+        for details.
+        """
+        return None
+
 def contains_unsupported_variable_type(graph, supports_floats,
                                               supports_longlong,
                                               supports_singlefloats):
diff --git a/pypy/rlib/jit.py b/pypy/rlib/jit.py
--- a/pypy/rlib/jit.py
+++ b/pypy/rlib/jit.py
@@ -738,3 +738,12 @@
         return hop.genop('jit_marker', vlist,
                          resulttype=lltype.Void)
 
+
+class JitPortal(object):
+    """ This is the main connector between the JIT and the interpreter.
+    Several methods on portal will be invoked at various stages of JIT running
+    like JIT loops compiled, aborts etc.
+
+    An instance of this class might be returned by the policy.get_jit_portal
+    method in order to function.
+    """
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to