#++

Dan Ingalls Dan.Ingalls at disney.com
Sun Jun 13 04:44:17 UTC 1999


Andres -

>I've just seen that it takes 4 bytecodes to increment a small integer
>by 1, namely:
>
>26 <11> pushTemp: 1
>27 <76> pushConstant: 1
>28 <B0> send: +
>29 <69> popIntoTemp: 1
>
>Wouldn't it be better to have another kind of bytecode, say
>
>26 <F0> incrementTemp: 1 by: 1 "F0 is my guess for an unused bytecode"

Yes, one can play tricks like this and save some real time.  For instance at the end of all the comparisons, the current interpreter peeks ahead for a branchIfFalseAndPop (which it almost always finds) and saves a lot of work.

The reason we haven't done more of this is that our plan has always been to put a decent dynamic translator in place (Jitter does exactly what ou want), and go the opposite way (toward greater simplicity) in the bytecode interpeter.

	- Dan





More information about the Squeak-dev mailing list