[pypy-svn] r62216 - pypy/branch/pyjitpl5/pypy/jit/metainterp

arigo at codespeak.net arigo at codespeak.net
Fri Feb 27 12:12:00 CET 2009


Author: arigo
Date: Fri Feb 27 12:12:00 2009
New Revision: 62216

Modified:
   pypy/branch/pyjitpl5/pypy/jit/metainterp/compile.py
   pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
Log:
Print more information to know what is being done with
each ENTER/LEAVE pair (i.e. each tracing operation).


Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/compile.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/compile.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/compile.py	Fri Feb 27 12:12:00 2009
@@ -45,6 +45,7 @@
 
 # the following is not translatable
 def _compile_new_loop_1(metainterp, loop, old_loops, endliveboxes):
+    orgloop = loop
     try:
         try:
             loop = compile_fresh_loop(metainterp, loop, old_loops,
@@ -53,13 +54,17 @@
             show_loop(metainterp, loop, loop.operations[0], exc)
             raise
         else:
-            show_loop(metainterp, loop, loop.operations[0], None)
+            if loop == orgloop:
+                show_loop(metainterp, loop, loop.operations[0], None)
+            else:
+                log.info("reusing loop at %r" % (loop,))
     except optimize.CancelInefficientLoop:
         return None
     loop.check_consistency()
     return loop
 
 def _compile_new_bridge_1(metainterp, bridge, old_loops, endliveboxes):
+    orgbridge = bridge
     try:
         try:
             bridge = compile_fresh_bridge(metainterp, bridge, old_loops,
@@ -68,7 +73,12 @@
             show_loop(metainterp, bridge, None, exc)
             raise
         else:
-            show_loop(metainterp, bridge, None, None)
+            if bridge == orgbridge:
+                show_loop(metainterp, bridge, None, None)
+            elif bridge is not None:
+                log.info("reusing bridge at %r" % (bridge,))
+            else:
+                log.info("compile_fresh_bridge() returned None")
     except optimize.CancelInefficientLoop:
         return None
     if bridge is not None:

Modified: pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/pyjitpl5/pypy/jit/metainterp/pyjitpl.py	Fri Feb 27 12:12:00 2009
@@ -464,9 +464,9 @@
         args = [descr.nonzero_func] + varargs
         return self.execute_with_exc('listnonzero', args, 'int')
 
-    @arguments("indirectcallset", "box", "varargs")
-    def opimpl_indirect_call(self, indirectcallset, box, varargs):
-        assert isinstance(box, Const) # XXX
+    @arguments("orgpc", "indirectcallset", "box", "varargs")
+    def opimpl_indirect_call(self, pc, indirectcallset, box, varargs):
+        box = self.implement_guard_value(pc, box)
         cpu = self.metainterp.cpu
         jitcode = indirectcallset.bytecode_for_address(box.getaddr(cpu))
         f = self.metainterp.newframe(jitcode)
@@ -776,18 +776,22 @@
     def interpret(self):
         # Execute the frames forward until we raise a DoneWithThisFrame,
         # a ContinueRunningNormally, or a GenerateMergePoint exception.
+        if isinstance(self.history, history.BlackHole):
+            text = ' (BlackHole)'
+        else:
+            text = ''
         if not we_are_translated():
-            history.log.event('ENTER')
+            history.log.event('ENTER' + text)
         else:
-            debug_print('ENTER')
+            debug_print('ENTER' + text)
         try:
             while True:
                 self.framestack[-1].run_one_step()
         finally:
             if not we_are_translated():
-                history.log.event('LEAVE')
+                history.log.event('LEAVE' + text)
             else:
-                debug_print('LEAVE')
+                debug_print('LEAVE' + text)
 
     def compile_and_run(self, *args):
         orig_boxes = self.initialize_state_from_start(*args)



More information about the Pypy-commit mailing list