[pypy-svn] r59375 - pypy/branch/oo-jit/pypy/jit/rainbow

arigo at codespeak.net arigo at codespeak.net
Fri Oct 24 16:47:38 CEST 2008


Author: arigo
Date: Fri Oct 24 16:47:38 2008
New Revision: 59375

Modified:
   pypy/branch/oo-jit/pypy/jit/rainbow/rhotpath.py
Log:
Remove a strange import.  This speeds up some tests because
importing i386 causes a lot of work in setting up multimethod
tables :-(


Modified: pypy/branch/oo-jit/pypy/jit/rainbow/rhotpath.py
==============================================================================
--- pypy/branch/oo-jit/pypy/jit/rainbow/rhotpath.py	(original)
+++ pypy/branch/oo-jit/pypy/jit/rainbow/rhotpath.py	Fri Oct 24 16:47:38 2008
@@ -2,7 +2,6 @@
 RPython support code for the hotpath policy.
 """
 
-from pypy.jit.codegen.i386.rgenop import cast_whatever_to_int
 from pypy.jit.timeshifter import rtimeshift, rvalue
 from pypy.rlib.objectmodel import we_are_translated, specialize
 from pypy.rpython.annlowlevel import cachedtype, base_ptr_lltype
@@ -75,6 +74,15 @@
                                           gv_exitfnptr, args_gv)
     leave_graph(interp)
 
+ at specialize.arg(0)
+def cast_whatever_to_int(T, value):
+    if isinstance(T, lltype.Ptr):
+        return lltype.cast_ptr_to_int(value)
+    elif T is llmemory.Address:
+        return llmemory.cast_adr_to_int(value)
+    else:
+        return lltype.cast_primitive(lltype.Signed, value)
+
 # ____________________________________________________________
 
 class FinishedCompiling(Exception):



More information about the Pypy-commit mailing list