[pypy-dev] [pypy-commit] pypy default: preallocate list to hold the locations of arguments to a call

Maciej Fijalkowski fijall at gmail.com
Sat Apr 13 19:24:40 CEST 2013


There is an optimization that does it for you FYI (or just use newlist_hint)

On Sat, Apr 13, 2013 at 6:13 PM, bivab <noreply at buildbot.pypy.org> wrote:
> Author: David Schneider <david.schneider at picle.org>
> Branch:
> Changeset: r63312:1bd588482153
> Date: 2013-04-13 18:00 +0200
> http://bitbucket.org/pypy/pypy/changeset/1bd588482153/
>
> Log:    preallocate list to hold the locations of arguments to a call
>
> diff --git a/rpython/jit/backend/arm/regalloc.py b/rpython/jit/backend/arm/regalloc.py
> --- a/rpython/jit/backend/arm/regalloc.py
> +++ b/rpython/jit/backend/arm/regalloc.py
> @@ -554,10 +554,9 @@
>          return self._prepare_call(op)
>
>      def _prepare_call(self, op, force_store=[], save_all_regs=False):
> -        args = []
> -        args.append(None)
> +        args = [None] * (op.numargs()+1)
>          for i in range(op.numargs()):
> -            args.append(self.loc(op.getarg(i)))
> +           args[i+1] = self.loc(op.getarg(i))
>          # spill variables that need to be saved around calls
>          self.vfprm.before_call(save_all_regs=save_all_regs)
>          if not save_all_regs:
> _______________________________________________
> 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