compiling to python byte codes

Diez B. Roggisch deetsNOSPAM at web.de
Fri Sep 3 06:54:32 EDT 2004


Maurice LING wrote:

> 
> I dont't quite get this right. Since x86/PPC uses register operations,
> why do virtual machines, like python's and java's, are designed as stack
> machines? Why not just stick to registers?

Because stacks are common to _all_ processors, where registers are differing
from architecture to architecture - the x86 hasn't been very gifted in that
respect (not sure if that changed recently - at least the SIMD instructions
introduced registers, but you can't rely on that beeing available)

So resorting to stacks makes the implementation totally independend of the
actual processor architecture - and stacks are as good as registers in
terms of abstract use.

What a JIT then does is purely up to its implementors - but thats another
topic.

-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list