Commits

Armin Rigo committed 59e2ee7

Remove a strange import. This speeds up some tests because
importing i386 causes a lot of work in setting up multimethod
tables :-(

  • Participants
  • Parent commits e415d56
  • Branches oo-jit

Comments (0)

Files changed (1)

File pypy/jit/rainbow/rhotpath.py

 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
                                           gv_exitfnptr, args_gv)
     leave_graph(interp)
 
+@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):