[pypy-svn] r52733 - pypy/branch/jit-hotpath/pypy/jit/rainbow

cfbolz at codespeak.net cfbolz at codespeak.net
Wed Mar 19 18:36:40 CET 2008


Author: cfbolz
Date: Wed Mar 19 18:36:38 2008
New Revision: 52733

Modified:
   pypy/branch/jit-hotpath/pypy/jit/rainbow/rhotpath.py
Log:
(cfbolz, arigo)  An issue with backends that erase Bool to Signed.


Modified: pypy/branch/jit-hotpath/pypy/jit/rainbow/rhotpath.py
==============================================================================
--- pypy/branch/jit-hotpath/pypy/jit/rainbow/rhotpath.py	(original)
+++ pypy/branch/jit-hotpath/pypy/jit/rainbow/rhotpath.py	Wed Mar 19 18:36:38 2008
@@ -174,7 +174,9 @@
 
     @specialize.arglltype(1)
     def check_should_compile(self, value):
-        assert lltype.typeOf(value) is lltype.Bool
+        # 'value' should be a Bool, but depending on the backend
+        # it could have been ERASED to about anything else
+        value = bool(value)
         threshold = self.hotrunnerdesc.threshold
         if value:
             counter = self.truepath_counter + 1
@@ -195,6 +197,7 @@
 
     @specialize.arglltype(2)
     def prepare_fallbackinterp(self, fallbackinterp, value):
+        value = bool(value)
         if value:
             fallbackinterp.pc = self.truepath_pc
         else:
@@ -202,6 +205,7 @@
 
     @specialize.arglltype(1)
     def compile_hot_path(self, value):
+        value = bool(value)
         if value:
             pc = self.truepath_pc
         else:



More information about the Pypy-commit mailing list