[pypy-svn] r67395 - pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Tue Sep 1 16:13:33 CEST 2009


Author: arigo
Date: Tue Sep  1 16:13:32 2009
New Revision: 67395

Added:
   pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp/executor.py.merge.tmp
      - copied, changed from r67389, pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp/executor.py
Log:
merging of svn+ssh://codespeak.net/svn/pypy/branch/pyjitpl5-llmodel/pypy/jit/metainterp/executor.py
revisions 67298 to 67389:

    ------------------------------------------------------------------------
    r67326 | arigo | 2009-08-29 18:23:36 +0200 (Sat, 29 Aug 2009) | 2 lines
    
    In-progress, more tests pass.
    
    ------------------------------------------------------------------------
    r67299 | arigo | 2009-08-29 11:56:39 +0200 (Sat, 29 Aug 2009) | 3 lines
    
    A branch to try to extract as much of the x86 backend as possible
    into generic code for LL backends.
    
    ------------------------------------------------------------------------


Copied: pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp/executor.py.merge.tmp (from r67389, pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp/executor.py)
==============================================================================
--- pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp/executor.py	(original)
+++ pypy/branch/pyjitpl5-llmodel-merge/pypy/jit/metainterp/executor.py.merge.tmp	Tue Sep  1 16:13:32 2009
@@ -230,6 +230,18 @@
 
 def make_execute_list(cpuclass):
     from pypy.jit.backend.model import AbstractCPU
+    if 0:     # enable this to trace calls to do_xxx
+        def wrap(fn):
+            def myfn(*args):
+                print '<<<', fn.__name__
+                try:
+                    return fn(*args)
+                finally:
+                    print fn.__name__, '>>>'
+            return myfn
+    else:
+        def wrap(fn):
+            return fn
     execute = [None] * (rop._LAST+1)
     for key, value in rop.__dict__.items():
         if not key.startswith('_'):
@@ -242,9 +254,9 @@
                 key = key[:-5]
             name = 'do_' + key.lower()
             if hasattr(cpuclass, name):
-                execute[value] = getattr(cpuclass, name)
+                execute[value] = wrap(getattr(cpuclass, name))
             elif name in globals():
-                execute[value] = globals()[name]
+                execute[value] = wrap(globals()[name])
             else:
                 assert hasattr(AbstractCPU, name), name
     cpuclass._execute_list = execute



More information about the Pypy-commit mailing list