[pypy-commit] pypy jit-multilabel: log the inputarg_setup_ops of the exported state to make intermediate jit-log-noopt-loop print proper traces

hakanardo noreply at buildbot.pypy.org
Sun Dec 18 11:14:42 CET 2011


Author: Hakan Ardo <hakan at debian.org>
Branch: jit-multilabel
Changeset: r50648:2d7b3df99c37
Date: 2011-12-18 11:12 +0100
http://bitbucket.org/pypy/pypy/changeset/2d7b3df99c37/

Log:	log the inputarg_setup_ops of the exported state to make
	intermediate jit-log-noopt-loop print proper traces

diff --git a/pypy/jit/metainterp/logger.py b/pypy/jit/metainterp/logger.py
--- a/pypy/jit/metainterp/logger.py
+++ b/pypy/jit/metainterp/logger.py
@@ -5,7 +5,7 @@
 from pypy.rpython.lltypesystem import lltype, llmemory, rffi
 from pypy.jit.metainterp.resoperation import rop
 from pypy.jit.metainterp.history import Const, ConstInt, Box, \
-     BoxInt, ConstFloat, BoxFloat, AbstractFailDescr
+     BoxInt, ConstFloat, BoxFloat, AbstractFailDescr, TargetToken
 
 class Logger(object):
 
@@ -135,6 +135,13 @@
             fail_args = ''
         return s_offset + res + op.getopname() + '(' + args + ')' + fail_args
 
+    def _log_inputarg_setup_ops(self, op):
+        target_token = op.getdescr()
+        if isinstance(target_token, TargetToken):
+            if target_token.exported_state:
+                for op in target_token.exported_state.inputarg_setup_ops:
+                    debug_print('    ' + self.repr_of_resop(op))
+        
     def _log_operations(self, inputargs, operations, ops_offset):
         if not have_debug_prints():
             return
@@ -146,6 +153,8 @@
         for i in range(len(operations)):
             op = operations[i]
             debug_print(self.repr_of_resop(operations[i], ops_offset))
+            if op.getopnum() == rop.LABEL:
+                self._log_inputarg_setup_ops(op)
         if ops_offset and None in ops_offset:
             offset = ops_offset[None]
             debug_print("+%d: --end of the loop--" % offset)


More information about the pypy-commit mailing list