[pypy-svn] r76041 - in pypy/branch/reflex-support/pypy/jit: metainterp tl

arigo at codespeak.net arigo at codespeak.net
Thu Jul 8 18:01:44 CEST 2010


Author: arigo
Date: Thu Jul  8 18:01:43 2010
New Revision: 76041

Modified:
   pypy/branch/reflex-support/pypy/jit/metainterp/pyjitpl.py
   pypy/branch/reflex-support/pypy/jit/metainterp/warmspot.py
   pypy/branch/reflex-support/pypy/jit/tl/pypyjit_child.py
Log:
Update pypyjit_child.py to force the jitcodes to be dumped to disk
in that case.


Modified: pypy/branch/reflex-support/pypy/jit/metainterp/pyjitpl.py
==============================================================================
--- pypy/branch/reflex-support/pypy/jit/metainterp/pyjitpl.py	(original)
+++ pypy/branch/reflex-support/pypy/jit/metainterp/pyjitpl.py	Thu Jul  8 18:01:43 2010
@@ -1099,10 +1099,12 @@
         """The 'residual_call' operation is emitted in two cases:
         when we have to generate a residual CALL operation, but also
         to handle an indirect_call that may need to be inlined."""
-        assert isinstance(funcbox, Const)
-        sd = self.metainterp.staticdata
-        key = sd.cpu.ts.getaddr_for_box(funcbox)
-        jitcode = sd.bytecode_for_address(key)
+        if isinstance(funcbox, Const):
+            sd = self.metainterp.staticdata
+            key = sd.cpu.ts.getaddr_for_box(funcbox)
+            jitcode = sd.bytecode_for_address(key)
+        else:
+            jitcode = None     # rare case (e.g. indirect low-level calls)
         if jitcode is not None:
             # we should follow calls to this graph
             return self.metainterp.perform_call(jitcode, argboxes)

Modified: pypy/branch/reflex-support/pypy/jit/metainterp/warmspot.py
==============================================================================
--- pypy/branch/reflex-support/pypy/jit/metainterp/warmspot.py	(original)
+++ pypy/branch/reflex-support/pypy/jit/metainterp/warmspot.py	Thu Jul  8 18:01:43 2010
@@ -66,11 +66,14 @@
 
 def jittify_and_run(interp, graph, args, repeat=1,
                     backendopt=False, trace_limit=sys.maxint,
-                    debug_level=DEBUG_STEPS, inline=False, **kwds):
+                    debug_level=DEBUG_STEPS, inline=False,
+                    write_jitcodes_directory=False, **kwds):
     translator = interp.typer.annotator.translator
     translator.config.translation.gc = "boehm"
     translator.config.translation.list_comprehension_operations = True
-    warmrunnerdesc = WarmRunnerDesc(translator, backendopt=backendopt, **kwds)
+    warmrunnerdesc = WarmRunnerDesc(translator, backendopt=backendopt,
+                             write_jitcodes_directory=write_jitcodes_directory,
+                                    **kwds)
     for jd in warmrunnerdesc.jitdrivers_sd:
         jd.warmstate.set_param_threshold(3)          # for tests
         jd.warmstate.set_param_trace_eagerness(2)    # for tests
@@ -144,7 +147,8 @@
 class WarmRunnerDesc(object):
 
     def __init__(self, translator, policy=None, backendopt=True, CPUClass=None,
-                 optimizer=None, ProfilerClass=EmptyProfiler, **kwds):
+                 optimizer=None, ProfilerClass=EmptyProfiler,
+                 write_jitcodes_directory=False, **kwds):
         pyjitpl._warmrunnerdesc = self   # this is a global for debugging only!
         self.set_translator(translator)
         self.build_cpu(CPUClass, **kwds)
@@ -173,6 +177,8 @@
         self.rewrite_jit_merge_points(policy)
 
         verbose = not self.cpu.translate_support_code
+        if write_jitcodes_directory:
+            verbose = False
         self.codewriter.make_jitcodes(verbose=verbose)
         self.rewrite_can_enter_jits()
         self.rewrite_set_param()

Modified: pypy/branch/reflex-support/pypy/jit/tl/pypyjit_child.py
==============================================================================
--- pypy/branch/reflex-support/pypy/jit/tl/pypyjit_child.py	(original)
+++ pypy/branch/reflex-support/pypy/jit/tl/pypyjit_child.py	Thu Jul  8 18:01:43 2010
@@ -35,5 +35,6 @@
     warmspot.jittify_and_run(interp, graph, [], policy=policy,
                              listops=True, CPUClass=CPUClass,
                              backendopt=True, inline=True,
+                             write_jitcodes_directory=True,
                              optimizer=OPTIMIZER_FULL)
 



More information about the Pypy-commit mailing list