**Tcl JIT** This year (2010) during Google Summer of Code a project for creating a Just-In-Time compiler for the Tcl language started its coding phase. It is still on a very initial phase, but it may be at least interesting to some people to get to know more about it without deciphering its code. The text below (after editing this for some more time) reflects the current state of the compiler. ***Phases*** ****Stack machine to Register machine**** ****Optimizations**** ****Register allocation**** ****Instruction selection**** ****Code generation**** ***References*** '''Advanced Compiler Design Implementation''' - ''Steven S. Muchnick''. This book starts right away indirectly mentioning the importance of different levels of intermediate representation. Converting the stack machine nature of the Tcl VM to quadruples was motivated by some of the reasons present on this book. The CACAO JVM (not sure if it still an active project) also performs this conversion, it might be interesting to read the paper '''CACAO - A 64 bit JavaVM Just-in-Time Compiler''' by ''Andreas Krall'' and ''Reinhard Grafl''. Register allocation is not done at all at this point, but, for now, the ones that are on the queue to be eventually implemented here are described in these papers: '''A Fast, Memory-Efficient Register Allocation Framework for Embedded Systems''', '''Linear Scan Register Allocation for the Java HotSpotTM Client Compiler''' (Master thesis, describes this process very well), '''Linear Scan Register Allocation on SSA Form''', '''Linear Scan Register Allocation'''. These represent basically two forms of register allocation: by density usage and linear scan (I believe this second is more known). Code generation for IA-32 was totally based on the Volumes 2A and 2B by Intel ('''Intel® 64 and IA-32 Architectures Software Developer’s Manual''') and also some disassembling (check the http://otx.osxninja.com/%|%otx%|% tool for Mac OS X, objdump under Linux was good too).