=== Top of the Swiki === Attachments ===

ThreadedCode

Threaded code is somewhat in the middle between native machine code and interpreted bytecodes such as the ones used by Squeak. An intro to various approaches to implementing threaded code is at http://www.complang.tuwien.ac.at/forth/threaded-code.html

Threaded code consists of lists of addresses, which are interpreted as entry points for functions which implement the behavior of one or a few bytecodes. In the current implementation, every byte of bytecode is translated into two 32-bits words of threaded code, of which the first is a function entry point and the second is a parameter to be used by that function.

The code used by IanPiumarta in Squeak 1.31 is Direct Threaded Code which means there is no central dispatcher loop which fetches addresses and calls the appropriate functions, but each function includes the fetch code and jumps directly to the next function.