[pypy-svn] r38056 - pypy/branch/jit-virtual-world/pypy/translator/c

arigo at codespeak.net arigo at codespeak.net
Wed Feb 7 13:25:31 CET 2007


Author: arigo
Date: Wed Feb  7 13:25:25 2007
New Revision: 38056

Modified:
   pypy/branch/jit-virtual-world/pypy/translator/c/exceptiontransform.py
Log:
(pedronis, arigo)
Change the direction of the check in exception transform.  A pure JIT hack.


Modified: pypy/branch/jit-virtual-world/pypy/translator/c/exceptiontransform.py
==============================================================================
--- pypy/branch/jit-virtual-world/pypy/translator/c/exceptiontransform.py	(original)
+++ pypy/branch/jit-virtual-world/pypy/translator/c/exceptiontransform.py	Wed Feb  7 13:25:25 2007
@@ -332,23 +332,23 @@
                     
         if alloc_shortcut:
             T = spaceop.result.concretetype
-            var_exc_occured = llops.genop('ptr_iszero', [spaceop.result],
-                                          lltype.Bool)            
+            var_no_exc = llops.genop('ptr_nonzero', [spaceop.result],
+                                     lltype.Bool)            
         else:
             v_exc_type = self.gen_getfield('exc_type', llops)
-            var_exc_occured = llops.genop('ptr_nonzero', [v_exc_type],
-                                          lltype.Bool)
+            var_no_exc = llops.genop('ptr_iszero', [v_exc_type],
+                                     lltype.Bool)
 
         block.operations.extend(llops)
         
-        block.exitswitch = var_exc_occured
+        block.exitswitch = var_no_exc
         #exception occurred case
         l = Link([error_constant(returnblock.inputargs[0].concretetype)], returnblock)
-        l.exitcase = l.llexitcase = True
+        l.exitcase = l.llexitcase = False
 
         #non-exception case
         l0 = block.exits[0]
-        l0.exitcase = l0.llexitcase = False
+        l0.exitcase = l0.llexitcase = True
 
         block.recloseblock(l0, l)
 



More information about the Pypy-commit mailing list