Virtual Machine Hacking (2003 and 2018 links)
Last updated at 6:40 am UTC on 11 February 2020
10-FEB-2003: Nearly all information below is out of date.
Enhancements for the base VM
li (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.csdownload
Other enhancements and extensions /h2
li 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 Popetells you exactly how to add your own primitives in: "The Do-It-Yourself Guide to Squeak Primitives" athttp://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 Mosnerdid some work on this, for version 1.18http://www.heeg.de/~hmm/squeak/2tagbits/
Ian Piumartabuilt a somewhat faster VM using a ContextCache, and has now finished a VM withDynamicTranslation(Just In Time compiling) toThreaded 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 Mosneradded matrix operations and 3D rendering primitives:Three-Dimensional Graphics
AlejandroReimondoadded an interface to support external API calls under Windows platformshttp://smalltalking.swiki.net/(please consider that references to him at SUGAR are obsolete and he canbe reached here)
Boris Shingarovadded another interface to support external API calls that works under OS/2 and will be ported to other platforms soonftp://visualage.dialogue.msu.su/pub/smalltalk/squeak/ He also added support for OS/2 callbacks to do native widgets from PresentationManager.
Hans-Martin Mosnerhas suspended work on the 3D stuff and now concentrates onDynamicPrimitives. When they work, he'll resume 3D, using the new tools.
Andreas Raabrecently addedNamed 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 Rowledgehas 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 Rowledgehas released VM/image changes to 'clean up' the CompiledMethod format and provide simpler extensions of source code accessing, plus error return values for primitives. Seehttp://sumeru.stanford.edu/tim/pooters/squeak.html. This is now adopted as an official projectNew Compiled Method Format and 3.0 Image
And there's more.Tim Rowledgehas 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 placehttp://sumeru.stanford.edu/tim/pooters/SqFiles/deltas Better code will appear someday.
Andrew C. Greenbergfigured out how to use Apple's (FREE!) MPW compiler to create Mac VMs:http://www.mucow.com/SqueakMPW.html
Scott Crosby has some tips onVirtual Machine Profiling
Building the VM
pMissing File (/squeak/uploads/VMDev%2BcommonSendFixup.cs)RootTableOverflows-ar.cs+