[pypy-commit] pypy inline-simple-generators: (fijal, hodgestar) unroll one iteration of generators

fijal noreply at buildbot.pypy.org
Sun Jul 24 19:42:38 CEST 2011


Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: inline-simple-generators
Changeset: r45948:b0e02ce2abbb
Date: 2011-07-24 19:42 +0200
http://bitbucket.org/pypy/pypy/changeset/b0e02ce2abbb/

Log:	(fijal, hodgestar) unroll one iteration of generators

diff --git a/pypy/module/pypyjit/interp_jit.py b/pypy/module/pypyjit/interp_jit.py
--- a/pypy/module/pypyjit/interp_jit.py
+++ b/pypy/module/pypyjit/interp_jit.py
@@ -44,9 +44,11 @@
             ec.w_tracefunc is None)
 
 def can_never_inline(next_instr, is_being_profiled, bytecode):
-    #return (bytecode.co_flags & CO_GENERATOR) != 0
     return False
 
+def should_unroll_one_iteration(next_instr, is_being_profiled, bytecode):
+    return (bytecode.co_flags & CO_GENERATOR) != 0
+
 def wrap_oplist(space, logops, operations):
     list_w = []
     for op in operations:
@@ -110,7 +112,9 @@
                               get_jitcell_at = get_jitcell_at,
                               set_jitcell_at = set_jitcell_at,
                               confirm_enter_jit = confirm_enter_jit,
-                              can_never_inline = can_never_inline)
+                              can_never_inline = can_never_inline,
+                              should_unroll_one_iteration =
+                              should_unroll_one_iteration)
 
 class __extend__(PyFrame):
 


More information about the pypy-commit mailing list