[pypy-commit] pypy default: Tentative fix for issue #2015. Didn't manage to write a test...

arigo noreply at buildbot.pypy.org
Fri Apr 3 14:37:47 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r76698:d6e8469e06ee
Date: 2015-04-03 11:32 +0200
http://bitbucket.org/pypy/pypy/changeset/d6e8469e06ee/

Log:	Tentative fix for issue #2015. Didn't manage to write a test...

diff --git a/rpython/jit/metainterp/optimizeopt/unroll.py b/rpython/jit/metainterp/optimizeopt/unroll.py
--- a/rpython/jit/metainterp/optimizeopt/unroll.py
+++ b/rpython/jit/metainterp/optimizeopt/unroll.py
@@ -438,6 +438,9 @@
         if op.is_ovf():
             guard = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
             optimizer.send_extra_operation(guard)
+        if op.is_call_pure_with_exception():
+            guard = ResOperation(rop.GUARD_NO_EXCEPTION, [], None)
+            optimizer.send_extra_operation(guard)
 
     def add_op_to_short(self, op, emit=True, guards_needed=False):
         if op is None:
@@ -471,6 +474,9 @@
             # FIXME: ensure that GUARD_OVERFLOW:ed ops not end up here
             guard = ResOperation(rop.GUARD_NO_OVERFLOW, [], None)
             self.add_op_to_short(guard, emit, guards_needed)
+        if op.is_call_pure_with_exception():
+            guard = ResOperation(rop.GUARD_NO_EXCEPTION, [], None)
+            self.add_op_to_short(guard, emit, guards_needed)
         for guard in value_guards:
             self.add_op_to_short(guard, emit, guards_needed)
 
diff --git a/rpython/jit/metainterp/resoperation.py b/rpython/jit/metainterp/resoperation.py
--- a/rpython/jit/metainterp/resoperation.py
+++ b/rpython/jit/metainterp/resoperation.py
@@ -176,6 +176,12 @@
     def returns_bool_result(self):
         return self._cls_has_bool_result
 
+    def is_call_pure_with_exception(self):
+        if self.getopnum() == rop.CALL_PURE:
+            effectinfo = self.getdescr().get_extra_info()
+            return effectinfo.check_can_raise()
+        return False
+
 
 # ===================
 # Top of the hierachy


More information about the pypy-commit mailing list