[pypy-svn] r35972 - in pypy/dist/pypy/translator/backendopt: . test

antocuni at codespeak.net antocuni at codespeak.net
Sun Dec 24 12:27:36 CET 2006


Author: antocuni
Date: Sun Dec 24 12:27:35 2006
New Revision: 35972

Modified:
   pypy/dist/pypy/translator/backendopt/inline.py
   pypy/dist/pypy/translator/backendopt/test/test_inline.py
Log:
Record all oosend as operations that could raise exceptions. Not sure
that it's the best way to do it; probably we will need some analysis
that maps each oosend to the set of graphs that could be called.



Modified: pypy/dist/pypy/translator/backendopt/inline.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/inline.py	(original)
+++ pypy/dist/pypy/translator/backendopt/inline.py	Sun Dec 24 12:27:35 2006
@@ -39,6 +39,8 @@
                 else:
                     for graph in graphs:
                         graphs_or_something[graph] = True
+            if op.opname == 'oosend':
+                graphs_or_something[op.args[0]] = True # XXX?
     return graphs_or_something
 
 def iter_callsites(graph, calling_what):

Modified: pypy/dist/pypy/translator/backendopt/test/test_inline.py
==============================================================================
--- pypy/dist/pypy/translator/backendopt/test/test_inline.py	(original)
+++ pypy/dist/pypy/translator/backendopt/test/test_inline.py	Sun Dec 24 12:27:35 2006
@@ -549,22 +549,7 @@
 
 class TestInlineOOType(OORtypeMixin, BaseTestInline):
 
-    def test_invalid_iterator(self):
-        py.test.skip('Fixme!')
-        def f():
-            try:
-                d = {'a': 1, 'b': 2}
-                for key in d:
-                    d[key] = 0
-                return True
-            except RuntimeError:
-                return False
-        eval_func, t = self.check_auto_inlining(f, [])
-        res = eval_func([])
-        assert res == False
-
     def test_rtype_r_dict_exceptions(self):
-        py.test.skip('Fixme!')
         from pypy.rlib.objectmodel import r_dict
         def raising_hash(obj):
             if obj.startswith("bla"):
@@ -584,3 +569,4 @@
         eval_func, t = self.check_auto_inlining(f, [])
         res = eval_func([])
         assert res == 42
+


More information about the pypy-svn mailing list