[pypy-dev] [pypy-commit] pypy default: fix jit translation, don't lookinside this function until ptradd works with things besides ccharp

Maciej Fijalkowski fijall at gmail.com
Thu Oct 25 11:21:09 CEST 2012


On Thu, Oct 25, 2012 at 4:38 AM, alex_gaynor <noreply at buildbot.pypy.org> wrote:
> Author: Alex Gaynor <alex.gaynor at gmail.com>
> Branch:
> Changeset: r58413:88158af0627f
> Date: 2012-10-24 19:38 -0700
> http://bitbucket.org/pypy/pypy/changeset/88158af0627f/
>
> Log:    fix jit translation, don't lookinside this function until ptradd
>         works with things besides ccharp

We can use raw_load and raw_store (from pypy.rlib.rawstorage) that can
be understood by the JIT. making ptradd understood is also not a big
deal.

>
> diff --git a/pypy/module/array/interp_array.py b/pypy/module/array/interp_array.py
> --- a/pypy/module/array/interp_array.py
> +++ b/pypy/module/array/interp_array.py
> @@ -9,6 +9,7 @@
>  from pypy.objspace.std.multimethod import FailedToImplement
>  from pypy.objspace.std.stdtypedef import SMM, StdTypeDef
>  from pypy.objspace.std.register_all import register_all
> +from pypy.rlib import jit
>  from pypy.rlib.rarithmetic import ovfcheck, widen
>  from pypy.rlib.unroll import unrolling_iterable
>  from pypy.rlib.objectmodel import specialize, keepalive_until_here
> @@ -466,6 +467,7 @@
>          self.setlen(0)
>          self.fromsequence(w_lst)
>
> +    @jit.dont_look_inside
>      def delslice__Array_ANY_ANY(space, self, w_i, w_j):
>          i = space.int_w(w_i)
>          if i < 0:
> @@ -495,13 +497,13 @@
>              rffi.c_memcpy(
>                  rffi.cast(rffi.VOIDP, rffi.ptradd(self.buffer, i)),
>                  rffi.cast(rffi.VOIDP, rffi.ptradd(oldbuffer, j)),
> -                (self.len - j) * mytype.bytes)
> +                (self.len - j) * mytype.bytes
> +            )
>          self.len -= j - i
>          self.allocated = self.len
>          if oldbuffer:
>              lltype.free(oldbuffer, flavor='raw')
>
> -
>      # Add and mul methods
>
>      def add__Array_Array(space, self, other):
> _______________________________________________
> pypy-commit mailing list
> pypy-commit at python.org
> http://mail.python.org/mailman/listinfo/pypy-commit


More information about the pypy-dev mailing list