[pypy-commit] pypy numpypy-problems: add some jit hints

mattip noreply at buildbot.pypy.org
Wed Oct 17 19:07:53 CEST 2012


Author: mattip <matti.picus at gmail.com>
Branch: numpypy-problems
Changeset: r58186:c9c13d8f38a8
Date: 2012-10-17 19:04 +0200
http://bitbucket.org/pypy/pypy/changeset/c9c13d8f38a8/

Log:	add some jit hints

diff --git a/pypy/module/micronumpy/types.py b/pypy/module/micronumpy/types.py
--- a/pypy/module/micronumpy/types.py
+++ b/pypy/module/micronumpy/types.py
@@ -1471,6 +1471,7 @@
 class StringType(BaseType, BaseStringType):
     T = lltype.Char
 
+    @jit.unroll_safe
     def coerce(self, space, dtype, w_item):
         from pypy.module.micronumpy.interp_dtype import new_string_dtype
         arg = space.str_w(space.str(w_item))
@@ -1479,6 +1480,7 @@
             arr.storage[i] = arg[i]
         return interp_boxes.W_StringBox(arr,  0, None)
 
+    @jit.unroll_safe
     def store(self, arr, i, offset, box):
         assert isinstance(box, interp_boxes.W_StringBox)
         for k in range(min(self.size, box.arr.size-offset)):
@@ -1489,6 +1491,7 @@
             dtype = arr.dtype
         return interp_boxes.W_StringBox(arr, i + offset, dtype)
 
+    @jit.unroll_safe
     def to_str(self, item):
         builder = StringBuilder()
         assert isinstance(item, interp_boxes.W_StringBox)


More information about the pypy-commit mailing list