[pypy-svn] r76155 - in pypy/branch/reflex-support/pypy: jit/codewriter translator/backendopt

arigo at codespeak.net arigo at codespeak.net
Mon Jul 12 18:43:31 CEST 2010


Author: arigo
Date: Mon Jul 12 18:43:30 2010
New Revision: 76155

Modified:
   pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py
   pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py
Log:
Fix the bug in a not-completely-satisfying way...


Modified: pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py
==============================================================================
--- pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py	(original)
+++ pypy/branch/reflex-support/pypy/jit/codewriter/effectinfo.py	Mon Jul 12 18:43:30 2010
@@ -104,3 +104,10 @@
     def analyze_simple_operation(self, op):
         return op.opname in ('jit_force_virtualizable',
                              'jit_force_virtual')
+
+    def analyze_unknown_indirect_call(self, op, seen=None):
+        # hack hack hack.  The idea is that no indirect_call(..., None)
+        # should force the virtuals or virtualizables, which is kind of
+        # roughly reasonable: such an operation may call either a C function
+        # or an 'instantiate' method from a class vtable.
+        return False

Modified: pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py
==============================================================================
--- pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py	(original)
+++ pypy/branch/reflex-support/pypy/translator/backendopt/graphanalyze.py	Mon Jul 12 18:43:30 2010
@@ -72,7 +72,7 @@
             return self.analyze_direct_call(graph, seen)
         elif op.opname == "indirect_call":
             if op.args[-1].value is None:
-                return self.top_result()
+                return self.analyze_unknown_indirect_call(op, seen)
             return self.analyze_indirect_call(op.args[-1].value, seen)
         elif op.opname == "oosend":
             name = op.args[0].value
@@ -124,6 +124,9 @@
             results.append(self.analyze_direct_call(graph, seen))
         return self.join_results(results)
 
+    def analyze_unknown_indirect_call(self, op, seen=None):
+        return self.top_result()
+
     def analyze_oosend(self, TYPE, name, seen=None):
         graphs = TYPE._lookup_graphs(name)
         return self.analyze_indirect_call(graphs, seen)



More information about the Pypy-commit mailing list