Author: Manuel Jacob <[email protected]>
Branch: 
Changeset: r81658:2dc5b1d863de
Date: 2016-01-10 19:05 +0100
http://bitbucket.org/pypy/pypy/changeset/2dc5b1d863de/

Log:    Remove handling of DelayedPointer in all analyze_external_call()
        methods.

        Delayed pointers to external functions don't make sense. The method
        analyze_external_call() was wrongly called because get_graph()
        returns None when encountering a delayed pointer and analyze()
        assumed it means that the function is an external function.

        A proper fix (with test) will be committed as a follow-up.

diff --git a/rpython/jit/codewriter/effectinfo.py 
b/rpython/jit/codewriter/effectinfo.py
--- a/rpython/jit/codewriter/effectinfo.py
+++ b/rpython/jit/codewriter/effectinfo.py
@@ -335,7 +335,7 @@
             funcobj = op.args[0].value._obj
             if funcobj.random_effects_on_gcobjs:
                 return True
-        except (AttributeError, lltype.DelayedPointer):
+        except AttributeError:
             return True   # better safe than sorry
         return super(RandomEffectsAnalyzer, self).analyze_external_call(
             op, seen)
diff --git a/rpython/memory/gctransform/framework.py 
b/rpython/memory/gctransform/framework.py
--- a/rpython/memory/gctransform/framework.py
+++ b/rpython/memory/gctransform/framework.py
@@ -36,10 +36,7 @@
         return graphanalyze.BoolGraphAnalyzer.analyze_direct_call(self, graph,
                                                                   seen)
     def analyze_external_call(self, op, seen=None):
-        try:
-            funcobj = op.args[0].value._obj
-        except lltype.DelayedPointer:
-            return True
+        funcobj = op.args[0].value._obj
         if getattr(funcobj, 'random_effects_on_gcobjs', False):
             return True
         return graphanalyze.BoolGraphAnalyzer.analyze_external_call(self, op,
diff --git a/rpython/translator/backendopt/graphanalyze.py 
b/rpython/translator/backendopt/graphanalyze.py
--- a/rpython/translator/backendopt/graphanalyze.py
+++ b/rpython/translator/backendopt/graphanalyze.py
@@ -56,10 +56,7 @@
         return self.bottom_result()
 
     def analyze_external_call(self, op, seen=None):
-        try:
-            funcobj = op.args[0].value._obj
-        except DelayedPointer:
-            return self.top_result()
+        funcobj = op.args[0].value._obj
         result = self.bottom_result()
         if hasattr(funcobj, '_callbacks'):
             bk = self.translator.annotator.bookkeeper
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to