Virtual Machine Hacking (out of date)
Last updated at 2:22 am UTC on 11 April 2007
10-FEB-2003: Nearly all information below is out of date. See Virtual Machine hacking for current info
Enhancements for the base VM
- (2002/01/29 - Crosby 3.2a#4646) New method cache, about 30-40% faster macroBenchmarks. Missing File (/squeak/uploads/VMDev%2BcommonSendFixup.cs)
- (2002/01/29 - Crosby 3.2a#4646) Make a root table overflow cost an incremental GC and a tenure instead of a full GC. Worth a few percent on macrobechmarks. Worth a lot more for software that analyzes large datasets. RootTableOverflows-ar.cs download
Other enhancements and extensions
- Primitives can be added easily using the CCodeGenerator. You can write them in Smalltalk, test them, add a few type hints, and translate them to C for speed. The sound primitives are done this way. Since the VM plugin system ( Named Primitives was created, adding primitives to the main VM is strongly deprecated and you ought to build subclasses of InterpreterPlugin.
- Stephen Travis Pope tells you exactly how to add your own primitives in: "The Do-It-Yourself Guide to Squeak Primitives" at http://www.create.ucsb.edu/squeak/DIYSqPrims.html. He has been busy adding primitives for MIDI and sound I/O, and for fast sound processing and mixing. His Siren VM/VI has many other enhancements aside from the added primitives.
- The VM can be changed to 2 tag bits for more immediate object kinds: immediate characters, points,... Hans-Martin Mosner did some work on this, for version 1.18 http://www.heeg.de/~hmm/squeak/2tagbits/
- Ian Piumarta built a somewhat faster VM using a ContextCache, and has now finished a VM with DynamicTranslation (Just In Time compiling) to Threaded Code. Should be 2x to 4x faster.
- Tim Rowledge modified the BitBltSimulation to support little-endian forms; speeds up display performance on little-endian systems. (As of Nov 18 '98, thisis withdrawn because nobody else was interested in using it. Not worth the effort to re-udate it for every release!)
- Hans-Martin Mosner added matrix operations and 3D rendering primitives: Three-Dimensional Graphics
- AlejandroReimondo added an interface to support external API calls under Windows platforms http://smalltalking.swiki.net/ (please consider that references to him at SUGAR are obsolete and he can be reached here)
- Boris Shingarov added another interface to support external API calls that works under OS/2 and will be ported to other platforms soon ftp://visualage.dialogue.msu.su/pub/smalltalk/squeak/ He also added support for OS/2 callbacks to do native widgets from PresentationManager.
- Hans-Martin Mosner has suspended work on the 3D stuff and now concentrates on DynamicPrimitives. When they work, he'll resume 3D, using the new tools.
- Andreas Raab recently added Named Primitives to the VM, a way of adding primitives without having to claim a primitive number. Currently works on Windows, ought to work on unix reasonably easily, Mac & Acorn, who knows?
- Tim Rowledge has a little goodie that is useful to anyone running the InterpreterSimulator on a little-endian machine - http://sumeru.stanford.edu/tim/pooters/SqFiles/deltas/VMsimulator.6Nov.cs
- He's at it again - Tim Rowledge has released VM/image changes to 'clean up' the CompiledMethod format and provide simpler extensions of source code accessing, plus error return values for primitives. See http://sumeru.stanford.edu/tim/pooters/squeak.html. This is now adopted as an official project New Compiled Method Format and 3.0 Image
- And there's more. Tim Rowledge has a starting version of general event input code, to help capture those events not related to the keyboard, mouse or network, such as 'Display resize'. It's in the usual place http://sumeru.stanford.edu/tim/pooters/SqFiles/deltas Better code will appear someday.
- Andrew C. Greenberg figured out how to use Apple's (FREE!) MPW compiler to create Mac VMs: http://www.mucow.com/SqueakMPW.html
- Scott Crosby has some tips on Virtual Machine Profiling
- Building the VM
Missing File (/squeak/uploads/VMDev%2BcommonSendFixup.cs)
Missing File (/squeak/uploads/RootTableOverflows-ar.cs)