[pypy-commit] pypy default: Fix the test.

arigo noreply at buildbot.pypy.org
Wed Nov 30 02:43:57 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r49991:b37ba47c5260
Date: 2011-11-30 02:39 +0100
http://bitbucket.org/pypy/pypy/changeset/b37ba47c5260/

Log:	Fix the test.

diff --git a/pypy/jit/codewriter/effectinfo.py b/pypy/jit/codewriter/effectinfo.py
--- a/pypy/jit/codewriter/effectinfo.py
+++ b/pypy/jit/codewriter/effectinfo.py
@@ -243,11 +243,20 @@
 class RandomEffectsAnalyzer(BoolGraphAnalyzer):
     def analyze_direct_call(self, graph, seen=None):
         if hasattr(graph, "func") and hasattr(graph.func, "_ptr"):
+            # the attribute _ptr is stored on the function 'graph.func'
+            # by rffi.llexternal().  It's a hack...
             if graph.func._ptr._obj.random_effects_on_gcobjs:
                 return True
         return super(RandomEffectsAnalyzer, self).analyze_direct_call(graph,
                                                                       seen)
 
+    def analyze_external_call(self, op, seen=None):
+        funcobj = op.args[0].value._obj
+        if funcobj.random_effects_on_gcobjs:
+            return True
+        return super(RandomEffectsAnalyzer, self).analyze_external_call(op,
+                                                                        seen)
+
     def analyze_simple_operation(self, op, graphinfo):
         return False
 
diff --git a/pypy/rpython/lltypesystem/rffi.py b/pypy/rpython/lltypesystem/rffi.py
--- a/pypy/rpython/lltypesystem/rffi.py
+++ b/pypy/rpython/lltypesystem/rffi.py
@@ -245,6 +245,7 @@
     wrapper._annspecialcase_ = 'specialize:ll'
     wrapper._always_inline_ = True
     # for debugging, stick ll func ptr to that
+    # (nowadays used in a not-for-debugging way by jit/codewriter/effectinfo)
     wrapper._ptr = funcptr
     wrapper = func_with_new_name(wrapper, name)
 


More information about the pypy-commit mailing list