[pypy-svn] r64012 - pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp

fijal at codespeak.net fijal at codespeak.net
Mon Apr 13 03:11:36 CEST 2009


Author: fijal
Date: Mon Apr 13 03:11:34 2009
New Revision: 64012

Modified:
   pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/warmspot.py
Log:
don't use lltype.cast_ptr_to_int. Ever.


Modified: pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/warmspot.py
==============================================================================
--- pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/warmspot.py	(original)
+++ pypy/branch/pyjitpl5-simplify/pypy/jit/metainterp/warmspot.py	Mon Apr 13 03:11:34 2009
@@ -364,9 +364,9 @@
         return lltype.cast_primitive(TYPE, box.getint())
 unwrap._annspecialcase_ = 'specialize:arg(0)'
 
-def cast_whatever_to_int(TYPE, x):
+def cast_whatever_to_int(TYPE, x, cpu):
     if isinstance(TYPE, lltype.Ptr):
-        return lltype.cast_ptr_to_int(x)
+        return cpu.cast_adr_to_int(llmemory.cast_ptr_to_adr(x))
     else:
         return lltype.cast_primitive(lltype.Signed, x)
 cast_whatever_to_int._annspecialcase_ = 'specialize:arg(0)'
@@ -418,7 +418,7 @@
                     box.changevalue_ptr(lltype.cast_opaque_ptr(llmemory.GCREF, value))
                 elif TYPE == lltype.Signed:
                     assert isinstance(box, history.BoxInt)
-                    box.changevalue_int(cast_whatever_to_int(TYPE, value))
+                    box.changevalue_int(value)
                 else:
                     raise AssertionError("box is: %s" % (box,))
             return boxes
@@ -524,7 +524,8 @@
                     result = result * mult
                     mult = mult + 82520 + 2*len(greenargs)
                 item = greenargs[i]
-                result = result ^ cast_whatever_to_int(TYPE, item)
+                result = result ^ cast_whatever_to_int(TYPE, item,
+                                                       warmrunnerdesc.cpu)
                 i = i + 1
             return result & self.hashtablemask
         getkeyhash._always_inline_ = True



More information about the Pypy-commit mailing list