[pypy-svn] r60805 - pypy/branch/oo-jit/pypy/rpython/lltypesystem

fijal at codespeak.net fijal at codespeak.net
Mon Jan 5 21:16:17 CET 2009


Author: fijal
Date: Mon Jan  5 21:16:14 2009
New Revision: 60805

Modified:
   pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py
Log:
ext registry entry for ll2ctypes.cast_adr_to_int


Modified: pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py
==============================================================================
--- pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py	(original)
+++ pypy/branch/oo-jit/pypy/rpython/lltypesystem/ll2ctypes.py	Mon Jan  5 21:16:14 2009
@@ -902,6 +902,20 @@
         return int(res)
     return res
 
+class CastAdrToIntEntry(ExtRegistryEntry):
+    _about_ = cast_adr_to_int
+
+    def compute_result_annotation(self, s_addr):
+        return annmodel.SomeInteger()
+
+    def specialize_call(self, hop):
+        assert isinstance(hop.args_r[0], raddress.AddressRepr)
+        adr, = hop.inputargs(hop.args_r[0])
+        hop.exception_cannot_occur()
+        return hop.genop('cast_adr_to_int', [adr],
+                         resulttype = lltype.Signed)
+    
+
 # ____________________________________________________________
 # errno
 



More information about the Pypy-commit mailing list