On 29/09/10 22:40, Terrence Cole wrote:

>> then, mylog contains all the loops and bridges produced by the jit. The
>> interesting point is that there are also special operations called
>> "debug_merge_point" that are emitted for each python bytecode, so you can
>> easily map the low-level jit instructions back to the original python source.
>
> I think that 'easily' in that last sentence is missing scare-quotes. :-)

well, it's easy as long as you have a bytecode-compiled version around. With 
only the AST I agree that it might be a bit trickier.

[cut]
> My first inclination would be to continue this chain and add a bytecode
> compiler on top of the ast builder.  This would keep ast node references
> in the instructions it creates.  If the algorithms don't diverge too
> much, I think this would allow the debug output to be mapped all the way
> back to the source chars with minimal effort.  I'm not terrifically
> familiar with the specifics of how python emits bytecode from an ast, so
> I'd appreciate any feedback if you think this is crazy-talk.

Are you using your custom-made AST or the one from the standard library? In 
the latter case, you can just pass the ast to the compile() builtin function 
to get the corresponding bytecode.

_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to