[pypy-dev] Annotating space status

Armin Rigo arigo at tunes.org
Fri Jul 4 21:56:56 CEST 2003


Hello Samuele,

On Wed, Jul 02, 2003 at 11:30:40PM +0200, Samuele Pedroni wrote:
>         r = self.codetest("def f():\n"
>                           "    x = g(1)\n"
>                           "    y = g('1')\n"
>                           "    return x\n" # vs. return y
>                           "def g(y):\n"
>                           "    return y\n",
>                           'f', [])
>         print r
> 
> in the 'return x' case r is W_Constant(1)
> in the 'return y' case r is W_Anything()
> 
> this is sort of bogus, and here too we should clarify what we want:

This can be fixed by replacing the current way the analysis is driven, which
is by really doing nested eval_frame() calls to follow the nested function
calls.  Instead, we should probably have a "pool" of frames waiting to be
analyzed, just like we currently do in CloningExecutionContext.eval_frame(),
but for all the frames instead of for a particular call.

For the problem with W_ConstantIterator I'm a bit confused. Where is the code 
that allows more than just one frame to be saved for the same bytecode 
position? In other words I don't understand how this code can unroll the loops 
in the helpers.

More generally I'd say that the current situation is confused because we try
to do the right thing for the specific goal of being able to translate RPython
to C, but what the right thing exactly is in this case is still unclear. I
think we should try to make a slightly more general but parametrizable
AnnotationObjectSpace.


A bientôt,

Armin.


More information about the Pypy-dev mailing list