[pypy-commit] pypy numpy-dtype-refactor: Specialize these properly
alex_gaynor
noreply at buildbot.pypy.org
Wed Nov 16 00:07:40 CET 2011
Author: Alex Gaynor <alex.gaynor at gmail.com>
Branch: numpy-dtype-refactor
Changeset: r49452:eb398ab0ef00
Date: 2011-11-15 18:07 -0500
http://bitbucket.org/pypy/pypy/changeset/eb398ab0ef00/
Log: Specialize these properly
diff --git a/pypy/rlib/libffi.py b/pypy/rlib/libffi.py
--- a/pypy/rlib/libffi.py
+++ b/pypy/rlib/libffi.py
@@ -411,6 +411,10 @@
def getaddressindll(self, name):
return dlsym(self.lib, name)
+# These specialize.call_location's should really be specialize.arg(0), however
+# you can't hash a pointer obj, which the specialize machinery wants to do.
+# Given the present usage of these functions, it's good enough.
+ at specialize.call_location()
@jit.oopspec("libffi_array_getitem(ffitype, width, addr, index, offset)")
def array_getitem(ffitype, width, addr, index, offset):
for TYPE, ffitype2 in clibffi.ffitype_map:
@@ -420,6 +424,7 @@
return rffi.cast(rffi.CArrayPtr(TYPE), addr)[0]
assert False
+ at specialize.call_location()
@jit.oopspec("libffi_array_setitem(ffitype, width, addr, index, offset, value)")
def array_setitem(ffitype, width, addr, index, offset, value):
for TYPE, ffitype2 in clibffi.ffitype_map:
@@ -428,4 +433,4 @@
addr = rffi.ptradd(addr, offset)
rffi.cast(rffi.CArrayPtr(TYPE), addr)[0] = value
return
- assert False
\ No newline at end of file
+ assert False
More information about the pypy-commit
mailing list