[pypy-dev] [pypy-commit] pypy jitframe-on-heap: fix for call_assembler with floats. The offset calculation for the arguments to call_assembler in rewrite.py assumes a double-word aligned JITFRAME

Maciej Fijalkowski fijall at gmail.com
Sun Feb 17 11:00:35 CET 2013


On Sun, Feb 17, 2013 at 4:00 AM, bivab <noreply at buildbot.pypy.org> wrote:
> Author: David Schneider <david.schneider at picle.org>
> Branch: jitframe-on-heap
> Changeset: r61341:017892f48c74
> Date: 2013-02-17 02:59 +0100
> http://bitbucket.org/pypy/pypy/changeset/017892f48c74/
>
> Log:    fix for call_assembler with floats. The offset calculation for the
>         arguments to call_assembler in rewrite.py assumes a double-word
>         aligned JITFRAME
>
> diff --git a/rpython/jit/backend/arm/arch.py b/rpython/jit/backend/arm/arch.py
> --- a/rpython/jit/backend/arm/arch.py
> +++ b/rpython/jit/backend/arm/arch.py
> @@ -17,4 +17,4 @@
>  # A jitframe is a jit.backend.llsupport.llmodel.jitframe.JITFRAME
>  # Stack frame fixed area
>  # Currently only the force_index
> -JITFRAME_FIXED_SIZE = 11 + 16 * 2 # 11 GPR + 16 VFP Regs (64bit)
> +JITFRAME_FIXED_SIZE = 12 + 16 * 2 # 11 GPR + one word to keep alignment + 16 VFP Regs (64bit)
> diff --git a/rpython/jit/backend/llsupport/rewrite.py b/rpython/jit/backend/llsupport/rewrite.py
> --- a/rpython/jit/backend/llsupport/rewrite.py
> +++ b/rpython/jit/backend/llsupport/rewrite.py
> @@ -179,6 +179,9 @@
>          for i, arg in enumerate(arglist):
>              descr = self.cpu.getarraydescr_for_frame(arg.type)
>              _, itemsize, _ = self.cpu.unpack_arraydescr_size(descr)
> +            # XXX
> +            # this calculation breaks for floats on 32 bit if
> +            # base_ofs of JITFRAME + index * 8 is not double-word aligned
>              index = index_list[i] // itemsize # index is in bytes
>              self.newops.append(ResOperation(rop.SETARRAYITEM_GC,
>                                              [frame, ConstInt(index),
> _______________________________________________
> pypy-commit mailing list
> pypy-commit at python.org
> http://mail.python.org/mailman/listinfo/pypy-commit

This fix is incorrect, I'll do the correct one later today (on GC you
have extra word for GC header, so you have to account for that)


More information about the pypy-dev mailing list