[pypy-dev] [pypy-svn] pypy jit-virtual_state: never retrace a loop more than 5 times

Maciej Fijalkowski fijall at gmail.com
Wed Feb 9 07:57:32 CET 2011


On Tue, Feb 8, 2011 at 8:42 PM, hakanardo <commits-noreply at bitbucket.org> wrote:
> Author: Hakan Ardo <hakan at debian.org>
> Branch: jit-virtual_state
> Changeset: r41714:91586ef4b9c5
> Date: 2011-02-08 19:42 +0100
> http://bitbucket.org/pypy/pypy/changeset/91586ef4b9c5/
>
> Log:    never retrace a loop more than 5 times

Is this always a good idea? Maybe we should have a configurable
parameter for that (like threshold).

>
> diff --git a/pypy/jit/metainterp/optimizeopt/unroll.py b/pypy/jit/metainterp/optimizeopt/unroll.py
> --- a/pypy/jit/metainterp/optimizeopt/unroll.py
> +++ b/pypy/jit/metainterp/optimizeopt/unroll.py
> @@ -671,7 +671,10 @@
>                                         "jumping to preamble instead")
>                             self.emit_operation(op)
>                         return
> -                if not self.retraced:
> +                retraced_count = len(short)
> +                if descr.failed_states:
> +                    retraced_count += len(descr.failed_states)
> +                if not self.retraced and retraced_count<5:
>                     if not descr.failed_states:
>                         raise RetraceLoop
>                     for failed in descr.failed_states:
> _______________________________________________
> pypy-svn mailing list
> pypy-svn at codespeak.net
> http://codespeak.net/mailman/listinfo/pypy-svn
>



More information about the Pypy-dev mailing list