[pypy-svn] r67852 - pypy/trunk/pypy/jit/tl

antocuni at codespeak.net antocuni at codespeak.net
Wed Sep 23 15:15:52 CEST 2009


Author: antocuni
Date: Wed Sep 23 15:15:51 2009
New Revision: 67852

Modified:
   pypy/trunk/pypy/jit/tl/pypyjit_child.py
Log:
- kill outdated comment

- factor out common code between lltype and ootype, thus enabling inlining also for ootype



Modified: pypy/trunk/pypy/jit/tl/pypyjit_child.py
==============================================================================
--- pypy/trunk/pypy/jit/tl/pypyjit_child.py	(original)
+++ pypy/trunk/pypy/jit/tl/pypyjit_child.py	Wed Sep 23 15:15:51 2009
@@ -4,25 +4,6 @@
 from pypy.module.pypyjit.policy import PyPyJitPolicy
 from pypy.rlib.jit import OPTIMIZER_FULL
 
-# Current output: http://paste.pocoo.org/show/106540/
-#
-# Some optimizations missing:
-#
-#   - remove the useless 'ec' argument (p1 and p115 in the trace)
-#
-#   - the guards have very long 'liveboxes' lists containing mostly
-#     Consts -- make sure that these Consts are not stored, or else
-#     remove them entirely
-
-# Some optimizations that might help under different circumstances:
-#
-#   - figure out who calls W_TypeObject.is_heaptype(), leading to
-#     the "int_and 512" (lines 48, 147, 154)
-#
-#   - improve the optimization: e.g. ooisnull followed by oononnull
-#     on the same variable
-#
-
 
 def run_child(glob, loc):
     import sys, pdb
@@ -34,26 +15,25 @@
         return lltype.nullptr(T)
     interp.heap.malloc_nonmovable = returns_null     # XXX
 
-    print 'warmspot.jittify_and_run() started...'
     from pypy.jit.backend.llgraph.runner import LLtypeCPU
     LLtypeCPU.supports_floats = False    # for now
-    policy = PyPyJitPolicy(interp.typer.annotator.translator)
-    option.view = True
-    warmspot.jittify_and_run(interp, graph, [], policy=policy,
-                             listops=True, CPUClass=LLtypeCPU,
-                             backendopt=True, inline=True,
-                             optimizer=OPTIMIZER_FULL)
+    apply_jit(interp, graph, LLtypeCPU)
 
 
 def run_child_ootype(glob, loc):
     import sys, pdb
     interp = loc['interp']
     graph = loc['graph']
+    from pypy.jit.backend.llgraph.runner import OOtypeCPU
+    apply_jit(interp, graph, OOtypeCPU)
+
 
+def apply_jit(interp, graph, CPUClass):
     print 'warmspot.jittify_and_run() started...'
-    from pypy.jit.backend.llgraph.runner import OOtypeCPU
     policy = PyPyJitPolicy(interp.typer.annotator.translator)
     option.view = True
     warmspot.jittify_and_run(interp, graph, [], policy=policy,
-                             listops=True, CPUClass=OOtypeCPU,
-                             backendopt=True)
+                             listops=True, CPUClass=CPUClass,
+                             backendopt=True, inline=True,
+                             optimizer=OPTIMIZER_FULL)
+



More information about the Pypy-commit mailing list