Author: Maciej Fijalkowski <[email protected]>
Branch: 
Changeset: r67566:1a8ee9ab87d4
Date: 2013-10-24 14:04 +0200
http://bitbucket.org/pypy/pypy/changeset/1a8ee9ab87d4/

Log:    attack the first part of slowness of stackcheckinsertion. I still
        dont understand why we have >1mln edges though

diff --git a/rpython/rlib/rstack.py b/rpython/rlib/rstack.py
--- a/rpython/rlib/rstack.py
+++ b/rpython/rlib/rstack.py
@@ -67,6 +67,7 @@
     # Else call the slow path
     stack_check_slowpath(current)
 stack_check._always_inline_ = True
+stack_check._dont_insert_stackcheck_ = True
 
 @rgc.no_collect
 def stack_check_slowpath(current):
@@ -74,3 +75,4 @@
         from rpython.rlib.rstackovf import _StackOverflow
         raise _StackOverflow
 stack_check_slowpath._dont_inline_ = True
+stack_check_slowpath._dont_insert_stackcheck_ = True
diff --git a/rpython/translator/transform.py b/rpython/translator/transform.py
--- a/rpython/translator/transform.py
+++ b/rpython/translator/transform.py
@@ -213,6 +213,10 @@
     insert_in = set()
     block2graph = {}
     for caller in translator.graphs:
+        pyobj = getattr(caller, 'func', None)
+        if pyobj is not None:
+            if getattr(pyobj, '_dont_insert_stackcheck_', False):
+                continue
         for block, callee in find_calls_from(translator, caller):
             if getattr(getattr(callee, 'func', None),
                        'insert_stack_check_here', False):
@@ -269,4 +273,4 @@
     transform_dead_op_vars(ann, block_subset)
     if ann.translator:
         checkgraphs(ann, block_subset)
- 
+
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to