[Vm-dev] VM team update

David T. Lewis lewis at mail.msen.com
Sun Apr 11 21:35:19 UTC 2010


We are in the midst of a flurry of activity to update the virtual machines
for Mac, Windows and Unix in support of upcoming Squeak and Pharo releases.
These VMs all will include Eliot Miranda's block closure support, as well
as a large number of updates, bug fixes, and enhancements. There have been
many significant updates to all of the major platforms, and I will not
attempt to do justice to all of these. That said, the revision logs for
the VMMaker package provide an overview of many of the changes, so I am
attaching an update log below.

It is worth noting here that John McIntosh has announced a new code base
for Mac VMs (in addition to his iPhone VM work) with expanded 64-bit
support.  This will be the basis for future Mac VM releases following
the current round of updates.

Following is a change log of the VMMaker package updates, starting with
current version, and going back to the introduction of block closure
support in early 2009.

- Dave

Name: VMMaker-dtl.169
Author: dtl
Time: 10 April 2010, 3:43:27.612 pm
Ancestors: VMMaker-ar.168

VMMaker 4.0.3

Add version identification primitives

- primitiveInterpreterSourceVersion answers the version of VMMaker that
  was used to generate the VM source code. This is a string like '4.0.3'.

- primitivePlatformSourceVersion answers the Subversion version level
  if $PLATFORM_SOURCE_VERSION has been defined, or fails otherwise.
  This should be a string like '2172'.

- primitiveVMVersion answers an identifier for the VM version (VMMaker
  plus Subversion) if $VM_VERSION is defined, or fails otherwise. For the
  Unix VMs, this is a string like '4.0.3-2172'.

- primitiveImageFormatVersion answers an integer identifier for the image
  format. This is the number that is stored in the image file header to
  identify image fomat (32/64 bit word size, block closure support).

Rename some code generation methods from #writeXXX to #emitXXX for
consistency with other method naming.

Fix VMMaker file list processing to ignore Subversion administrative
files (previously only CVS files were ignored).

Name: VMMaker-ar.168
Author: ar
Time: 31 March 2010, 9:46:52 am
Ancestors: VMMaker-ar.167

Bump VMMaker version to 4.0.2.

Name: VMMaker-ar.167
Author: ar
Time: 31 March 2010, 9:44:42 am
Ancestors: VMMaker-JMM.166

Fix SoundPlugin>>primSoundRecordSamplesInto again. Performs subtraction
in the primitive, calls external code with the offset ALWAYS set to zero.
Should be rationalized by removing the arg from the support code call.

Name: VMMaker-JMM.166
Author: JMM
Time: 28 March 2010, 4:57:23 pm
Ancestors: VMMaker-dtl.119, VMMaker-dtl.122, VMMaker-dtl.135,
VMMaker-dtl.139, VMMaker-dtl.153, VMMaker-dtl.156, VMMaker-ar.160,
VMMaker-ar.165, VMMaker-dtl.165

Merge some 64bit fixes
filename is not an (int) address on 64bit systems
&portName is not an int
64bits NULL is not int
not 64bit clean
dispBits is unsigned char*

Ensure microsecond clock is 64bit
are all sqLong
startTime,statGCTime  as sqLong
primitiveVMParameter has microsecond clock times 64bit
32 clean desiredHeapSize is unsigned

Name: VMMaker-dtl.165
Author: dtl
Time: 28 March 2010, 6:54:54 pm
Ancestors: VMMaker-dtl.164

Fix declaration of readImageFromFile:HeapSize:StartingAt: as per John's note
at http://lists.squeakfoundation.org/pipermail/vm-dev/2010-January/003614.html

Name: VMMaker-dtl.164
Author: dtl
Time: 28 March 2010, 1:44:25 pm
Ancestors: VMMaker-eem.163

VMMaker 4.0.1
Reference Mantis 7458: [Vm-dev] microsecond timing for GC work

Add primitiveMicrosecondClock and microsecond GC instrumentation by John McIntosh.
Add primitiveUtcWithOffset.
Fix signature of Interpreter>>dumpImage: (pointer declared as int).

The new primitives require support in the platform code. Default implementations
are provided to allow compilation without these platforms updates, see

Without platform updates, the GC instrumentation falls back to millisecond
precision, the primitiveMicrosecondClock primitive answers (incorrectly) a
millisecond value, and primitiveUtcWithOffset fails the primitive.

Name: VMMaker-eem.163
Author: eem
Time: 22 March 2010, 5:15:57 pm
Ancestors: VMMaker-ar.162

SoundPlugin: fix bounds bug in primitiveSoundRecordSamples.  The
call to snd_RecordSamplesIntoAtLength neglected to subtract the
start index from the size of the buffer to be written into.

Name: VMMaker-ar.162
Author: ar
Time: 15 March 2010, 4:02:31 am
Ancestors: VMMaker-dtl.161

Fix loading of image segments that are from older, but compatible image

Name: VMMaker-dtl.161
Author: dtl
Time: 14 March 2010, 9:19:53 am
Ancestors: VMMaker-ar.160

VMMaker 4.0.0

Change #versionString from 3.x.x to 4.0.0. This is to align version numbering
with the Squeak 4.0 release, and does not reflect a functional change in
the VM. 

Change layout calculation in VMMakerTool to produce acceptable cosmetic layout
for Squeak trunk, Pharo and other images. Font size calculation in Squeak trunk
seems inconsistent with other images, so this change may be only a workaround
for a bug in Squeak trunk.

Name: VMMaker-ar.160
Author: ar
Time: 10 March 2010, 10:57:23 am
Ancestors: VMMaker-dtl.159

Add David's fix for removing the inline definition of error().

Name: VMMaker-dtl.159
Author: dtl
Time: 24 February 2010, 9:15:48 am
Ancestors: VMMaker-ar.158

VMMaker 3.11.14
Fix (- 16) syntax problem in BalloonEnginePlugin>>shortRunLengthAt:from:
Bump versionString to 3.11.14 to reflect this change plus FFIPlugin updates
incorporated in the last MC update.

Name: VMMaker-ar.158
Author: ar
Time: 11 February 2010, 12:25:42 pm
Ancestors: VMMaker-dtl.157

Merge ExternalForm primitives from Josh.

Name: VMMaker-dtl.157
Author: dtl
Time: 29 January 2010, 12:14:34 pm
Ancestors: VMMaker-dtl.156

VMMaker 3.11.13
Reference Mantis 0007461: Bulletproof BitBltSimulation against failure in

Add patch from Josh Gargus to fix bug where #warpBits does not check the
return value of #lockSurfaces, and can potentially crash when execution
continues after the failed lock attempt.

Name: VMMaker-dtl.156
Author: dtl
Time: 11 January 2010, 5:39:24 am
Ancestors: VMMaker-dtl.155

VMMaker 3.11.12
Reference Mantis 7103: Playing sounds in linux 64 bits causes a vm
segmentation fault

Add changes to permit SoundPlugin to work on 64 bit platforms. Corresponding
changes are required for platform support code.

Platforms sources are currently at Subversion revision level 2147. Later
revision levels will contain the patches to match this version of VMMaker.
See Mantis 7103 for details.

Name: VMMaker-dtl.155
Author: dtl
Time: 20 December 2009, 10:22:54 am
Ancestors: VMMaker-dtl.154

VMMaker 3.11.11
Fix Interpreter>>byteSizeOf: to use #bytesPerWord rather than '4'.

Name: VMMaker-dtl.154
Author: dtl
Time: 2 December 2009, 11:34:41 am
Ancestors: VMMaker-dtl.153

Updated class comment for MiscPrimitivePlugin with information provided by Andreas
in http://lists.squeakfoundation.org/pipermail/vm-dev/2009-December/003514.html

Name: VMMaker-dtl.153
Author: dtl
Time: 27 November 2009, 4:49:50 am
Ancestors: VMMaker-dtl.152

VMMaker 3.11.10

Reference Mantis 7421: Bug in Interpreter>>primitiveNextPut:
Bug found and fixed by Henrik Johansen <henrik.s.johansen at veloxit.no>

Name: VMMaker-dtl.152
Author: dtl
Time: 17 November 2009, 8:10:32 am
Ancestors: VMMaker-dtl.151

VMMaker 3.11.9
Update KlattSynthesizerPlugin to refer to separately packaged pool variables,
removing dependency on complete Speech package.

Name: VMMaker-dtl.151
Author: dtl
Time: 14 November 2009, 9:54:55 am
Ancestors: VMMaker-dtl.150

Add "VMMaker updateFromServer" for updating from a Monticello configuration

Name: VMMaker-dtl.150
Author: dtl
Time: 11 November 2009, 9:13:25 pm
Ancestors: VMMaker-ar.149

Add missing isExpression instance variable to TSendNode, apparently lost
from dusty change set when integrating CPP macro generation for

Name: VMMaker-ar.149
Author: ar
Time: 9 November 2009, 10:41:59 am
Ancestors: VMMaker-mtf.148

Small tweak for VMMaker appearance observed in latest trunk image. Makes the
input fields solid gray to avoid bleeding the labels into the input fields.

Name: VMMaker-mtf.148
Author: mtf
Time: 5 November 2009, 10:56:58 am
Ancestors: VMMaker-dtl.147

no more underscore assignments

Name: VMMaker-dtl.147
Author: dtl
Time: 1 November 2009, 12:00 am
Ancestors: VMMaker-dtl.146

VMMaker 3.11.8

Reference Mantis 7407: BitBlt. Incorrect alpha values for several rules.

Add VMMaker-BitBlt-AlphaFixes-jmv-M7407.cs bitblt alpha fixes by Juan Vuletich

Name: VMMaker-dtl.146
Author: dtl
Time: 29 October 2009, 12:00 am
Ancestors: VMMaker-dtl.145

VMMaker 3.11.7

Reference Mantis 7407: BitBlt. Incorrect alpha values for several rules.

Changes and fixes provided by Juan Vuletich:

Add missing memory access methods to BitBltSimulator and CArrayAccessor,
required for bitblt simulation since the original Squeak 64 bit work but
apparently omitted by accident.

Add BitBltSimulationTest with two test methods moved from BitBltTest. The
corresponding tests should be removed from BitBltTest at a later date
(follow up required).

Add package category VMMaker-Tests as a home for BitBltSimulationTest and
hopefully for other tests in the future.

Name: VMMaker-dtl.145
Author: dtl
Time: 25 October 2009, 12:00 am
Ancestors: VMMaker-dtl.144

VMMaker 3.11.6

Fix incorrect use of zero index in #replaceLastOccurrence:with: that
caused Slang inlining failure when running on a 64-bit image.

Name: VMMaker-dtl.144
Author: dtl
Time: 24 October 2009, 12:00 am
Ancestors: VMMaker-dtl.143

Add a "Rescan" button to VMMakerTool to scan the image, adding any new
plugins and removing those no longer available. Allows a VMMakerTool
configuration to be updated e.g. after loading a new plugin from SqueakSource.
Per suggestion from Ian.

Name: VMMaker-dtl.143
Author: dtl
Time: 20 October 2009, 12:00 am
Ancestors: VMMaker-dtl.142

VMMaker 3.11.5

Reference Mantis 7405: Array new: SmallInteger maxVal broken.

Change Set:		ObjectAllocationSizeFixes-dtl-M7405
Date:			20 October 2009
Author:			David T. Lewis

Requests for very large object allocation result in various failures including
VM crashes and incorrect results from primitive calls. This change set adds
checks for arithmetic overflow in calculation of size requests, and limits
the maximum size of a #growObjectMemory request to 16r7FFFFFFF to permit use
of signed 32-bit integer arithmetic in the support code. Also included are some
variable type declarations and removal of a now unnecessary #oop:isLessThan:

There may be additional bugs in the support code, which is expected to fail
gracefully even if someone requests an object memory size increase of
16r80000000 or more.

In testing on a Linux VM, allocation of objects of size greater than 950MB
appears to be possible, given enough physical memory to permit the allocation
to succeed. I do not have sufficient real memory on my system to verify the
actual results, although I can confirm that this is an effective way to bring
a Linux system to its knees.

Name: VMMaker-dtl.142
Author: dtl
Time: 7 October 2009, 12:00 am
Ancestors: VMMaker-dtl.141

VMMaker 3.11.4

Provide hooks for Alien FFI, add #callInterpreter exported for external calls
into #interpret and turn off inlining for #interpret.

Name: VMMaker-dtl.141
Author: dtl
Time: 7 October 2009, 12:00 am
Ancestors: VMMaker-dtl.140

Use #oop:isGreaterThanOrEqualTo: in #sufficientSpaceAfterGC: for consistency
and readability. No functional change to generated C code.

Name: VMMaker-dtl.140
Author: dtl
Time: 28 September 2009, 12:00 am
Ancestors: VMMaker-dtl.139

Implement #imageFormatVersion in InterpreterSimulator to allow the simulator
to load images with closure bytecodes.

Change comment in ObjectMemory>>bytesPerWord to avoid confusion with C pointer

Fix typo in InterpreterSimulator>>openOn:extraMemory: to change spelling of
'incomaptible'. Sorry to eliminate such a marvellous word from the image.
I had hoped for an etymological link to the field of motivational finance,
but alas it seems to be a common misspelling.

Name: VMMaker-dtl.139
Author: dtl
Time: 16 September 2009, 9:43:58 pm
Ancestors: VMMaker-dtl.138

Cosmetic fix - better timestamp format for comments in generated source files.

Name: VMMaker-dtl.138
Author: dtl
Time: 2 September 2009, 8:24:56 am
Ancestors: VMMaker-dtl.137

Add VMMMAKER_VERSION macro to the vm/interp.h header file to identify
approximate source code version of generated sources (per ar suggestion)

Name: VMMaker-dtl.137
Author: dtl
Time: 24 August 2009, 7:33:10 am
Ancestors: VMMaker-dtl.136

VMMaker 3.11.3

Use UIManager for directory selection if possible, or fall back to FileList2
for older images. Update required for Pharo images.

Name: VMMaker-dtl.136
Author: dtl
Time: 22 August 2009, 3:23:29 pm
Ancestors: VMMaker-dtl.135

VMMaker 3.11.2

Reference Mantis 7266: SerialPlugin doesn't handle arbitrary nodes names

Add support for named serial devices for SerialPlugin. The new primitives
and support code are by Severin Lemaignan <severin.lemaignan at laas.fr>,
with portions reimplemented here by dtl.

Also changes method signatures to declare pointers correctly, permitting
SerialPlugin to work on 64-bit host platforms. Additional platform code
changes are required to match.

Name: VMMaker-dtl.135
Author: dtl
Time: 18 August 2009, 7:49:41 am
Ancestors: VMMaker-dtl.134

Reference Mantis 7384: GeniePlugin does not compile on closure-enabled images

Eliminate two temporary variables from the GeniePlugin primitive to permit
it to compile on closure-enabled images.

Name: VMMaker-dtl.134
Author: dtl
Time: 14 August 2009, 10:15:48 am
Ancestors: VMMaker-dtl.133

VMMaker 3.11.1

Reference Mantis 5238: Integer bug on 64bit image/32bit VM,
DateAndTime now ==> -4391-12-26T16:18:33+00:00.

See Mantis report for tests and performance evaluation.

Provide an implementation of #isIntegerValue: that is both fast and correct
on all combinations of 32 bit and 64 bit image and host.

The implementation of #isIntegerValue: by tpr is fast, but does not work
for a 64 bit image. The implementation of #isIntegerValue: by ikp is slower
(especially on 32 bit hosts), but works correctly on 64 bit images.

This is an implementation of #isIntegerValue: that uses conditional
compilation to select the fastest correct implemention for the given
image and host word size.

Eventually this method will need to change again when the range of
SmallInteger is increased for 64 bit images.

Name: VMMaker-dtl.133
Author: dtl
Time: 14 August 2009, 10:01:20 am
Ancestors: VMMaker-dtl.132

VMMaker 3.11.0

Add support for C preprocessor statements in Slang.

Three new methods are supported:

Conditional preprocessor directives can be used to direct compilation
of statement lists (the common usage), or they may be embedded within C

See Mantis 5238 for change set VMMakerCppTranslation-dtl, merged into
current VMMaker

Name: VMMaker-dtl.132
Author: dtl
Time: 13 August 2009, 1:19:02 am
Ancestors: VMMaker-dtl.131

VMMaker 3.10.8

Reference Mantis 7377: VM Crashes when setting port on destroyed socket (Win32)

Patch (provided by Andreas) adds a guard test in
SocketPlugin>>primitiveSocket:listenOnPort: to prevent calling
sqSocketListenOnPort() when the primitive has already failed.

Name: VMMaker-dtl.131
Author: dtl
Time: 10 August 2009, 10:45:01 pm
Ancestors: VMMaker-dtl.130

VMMaker 3.10.8

Reference Mantis 7376: Bug in BitBlt (rgbMul sets alpha to 0)
Patch provided by Juan Vuletich.

Rule 37 sets alpha to zero if the destination is 32 bit. This affects
antialiased StrikeFonts.

This is related to the stuff I (jmv) fixed in April (0007327), but it
is a different bug in a different method, that I didn't find that
time: #partitionedMul:with:nBits:nPartitions: ignores the last argument,
and acts as if it was always 3.

With this fix, the second bitblt pass for aa strike fonts will not be needed
anymore if text is black, meaning a small performance improvement, aside
from correct bitblt behavior.

Name: VMMaker-dtl.130
Author: dtl
Time: 4 August 2009, 11:36:14 pm
Ancestors: VMMaker-dtl.129

Change VMMakerTool selection box label from '64-bit word' to '64-bit image'.

Name: VMMaker-dtl.129
Author: dtl
Time: 4 August 2009, 10:04:21 pm
Ancestors: VMMaker-dtl.128

The '64 bit VM?' selection box in VMMakerTool can be confusing for first-time
VM builders. This change attempts to clarify the label and balloon help.

Change label on selection box from '64 bit VM?' to '64-bit word', and balloon
help from 'Set to build a 32 bit VM or a 64 bit VM' to 'Build (32- or 64-bit)
VM to run 64-bit images. Default is false to support normal 32-bit images.'.

Name: VMMaker-dtl.128
Author: dtl
Time: 3 August 2009, 7:46:17 pm
Ancestors: VMMaker-dtl.127

Reference Mantis 7374: Inlining may cause broken C code

A more general solution to TMethod-renameVars-dtl-M7374 that does better
substring substitution when swizzling the C declaration.

Name: VMMaker-dtl.127
Author: dtl
Time: 1 August 2009, 11:26:23 pm
Ancestors: VMMaker-dtl.126

Reference Mantis 7374: Inlining may cause broken C code

Change Set:		TMethod-renameVars-dtl-M7374
Date:			1 August 2009
Author:			David T. Lewis

When renaming local variables for an inlined method, ensure that only the
variable name is affected. Previously the expression declaration 'int i' was
renamed to 'i1nt i1' due to naive use of copyReplaceAll.

Name: VMMaker-dtl.126
Author: dtl
Time: 18 July 2009, 10:06:01 pm
Ancestors: VMMaker-dtl.125

Correct misspelling of "receiver" in several method comments, noted by Eliot.

Name: VMMaker-dtl.125
Author: dtl
Time: 5 July 2009, 10:52:01 pm
Ancestors: VMMaker-dtl.124

VMMaker 3.10.7

Move some C code generator methods from kernel and collections packages into
VMMaker package. Janatorial, see Mantis 7221.

Follow up required: These methods will need to be removed from the kernel
and collections packages at a later date.

Name: VMMaker-dtl.124
Author: dtl
Time: 1 July 2009, 7:14:48 pm
Ancestors: VMMaker-dtl.123

VMMaker 3.10.6
Update to patches for Mantis 7260: some Float comparison primitives don't
handle Nan correctly

Change Set:		M7260-bytecodePrimGreaterEqual-update-dtl
Date:			1 July 2009
Author:			David T. Lewis

One too many double negatives in the last patch. Reported by Bert and
confirmed by Andreas and Nicolas, see

Name: VMMaker-dtl.123
Author: dtl
Time: 12 June 2009, 7:35:20 am
Ancestors: VMMaker-dtl.122

VMMaker 3.10.5
Reference Mantis 7260: some Float comparison primitives don't handle Nan correctly

Change Set:		M7260-primitiveSmallIntegerCompareNan-Patch-nice
Date:			4 January 2009
Author:			nice

This is a patch for bug http://bugs.squeak.org/view.php?id=7260

2 >= Float nan should be false.
It used to be true...

This patch applies to tricky handling of some special arithmetic bytecode
when receiver is a SmallInteger.

Change Set:		M7260-primitiveFloatCompareNan-Patch-nice
Date:			4 January 2009
Author:			nice

This is a patch for bug http://bugs.squeak.org/view.php?id=7260

2.0 >= Float nan should be false.
It used to be true...

Name: VMMaker-dtl.122
Author: dtl
Time: 5 May 2009, 7:55:55 pm
Ancestors: VMMaker-dtl.121

Change Set:		ClosureVMPopKiller-M7349
Date:			5 May 2009
Author:			John M McIntosh

Fix for mantis 7349, extra pop unbalances stack, causes closure VM to die 

Name: VMMaker-dtl.121
Author: dtl
Time: 30 April 2009, 10:56:31 pm
Ancestors: VMMaker-dtl.120

Fix two methods with assignment to block temp arguments, reported on
vm-dev list:

> On Thu, Apr 30, 2009 at 8:43 AM, Igor Stasenko <siguctua at gmail.com> wrote:
>> There are multiple issues, when loading VMMaker into closure-aware
>> image (10292).
>> two #needsToRegenerateInterpreterFile methods
>> storing into block args. Fix is easy and quick.

Name: VMMaker-dtl.120
Author: dtl
Time: 12 April 2009, 12:51:35 pm
Ancestors: VMMaker-dtl.119

VMMaker 3.10.4
Reference Mantis 6987: signed32BitValueOf:, signed64BitValueOf: etc. broken

Change Set:		Interpreter-signed32BitIntegerFor-dtl-M6987
Date:			12 April 2009
Author:			David T. Lewis

This is a fix for #signed32BitIntegerFor: on 64-bit images. It adds a
declaration for the method parameter as type int, such that the passed
value is coerced from (possibly 64 bit) sqInt to int. This provides the
correct behavior when used on a 64 bit image.

This change set should be applied in addition to the changes in

If the 64-bit FFI changes for M7237 are also applied, then the FFITestCase
tests in M6987 are all green for 64-bit host and 64-bit image.

Name: VMMaker-dtl.119
Author: dtl
Time: 1 April 2009, 10:45:59 pm
Ancestors: VMMaker-ar.118

VMMaker 3.10.2

Reference Mantis 0007327: Bug in BitBlt: rgbMin and other set alpha to 0
Fix provided by Juan Vuletich (jmv)
Confirmed by Andreas Raab

Name: VMMaker-ar.118
Author: ar
Time: 28 March 2009, 12:27:45 am
Ancestors: VMMaker-dtl.117

Updated SocketPlugin for IPv6 primitives.

Name: VMMaker-dtl.117
Author: dtl
Time: 12 March 2009, 11:15:44 pm
Ancestors: VMMaker-dtl.116

VMMaker version 3.10.2

Reference Mantis 0006987: signed32BitValueOf:, signed64BitValueOf: etc. broken

Change Set:		Int32Fixes-dtl-M6987
Update #signed32BitValueOf: based on Andreas fix plus extra range checks to
fail prim on invalid values. Add type cast to #primitiveIntegerAt, required
for 64 bit image.

Change Set:		Int64Fixes-dtl-M6987
Update #signed64BitIntegerFor: and #signed64BitValueOf: to work properly for
full range of 64 bit signed integers.

Moved several primitives from "sound primitives" to "array primitives",
removed category "sound primitives".

See IntegerArrayTestCase-dtl-M6987 for tests.

Name: VMMaker-dtl.116
Author: dtl
Time: 23 February 2009, 9:29:58 am
Ancestors: VMMaker-dtl.115

VMMaker 3.10.1
Fix type cast problem in #pushClosureCopyCopiedValuesBytecode. Stored
value should be SmallInteger oop, not a C pointer. Change from:
  (self cCoerce: localIP to: 'sqInt')
  (self oopForPointer: localIP)

Fix confirmed by eem

Name: VMMaker-dtl.115
Author: dtl
Time: 22 February 2009, 3:21:29 pm
Ancestors: VMMaker-dtl.113, VMMaker-eem.114

VMMaker 3.10
Update to permit loading in vanilla Squeak. Changes are:
- Change #primitiveDoNamedPrimitiveWithArgs to use #var:declareC: rather
  than pragma.
- Remove unreference instance variables in Interpreter.
- Reorganize method categories in Interpreter (hopefully as per eem intent).
- Restore ordering of class vars in various classes (inadvertently reordered
  by Montecello).
- Update versionString to '3.10'.
- Fix comment typo in #activateNewClosureMethod:

Note: one additional update will follow, to address type cast issue in

Name: VMMaker-eem.114
Author: eem
Time: 18 February 2009, 5:42:18 pm
Ancestors: VMMaker-dtl.113

Closure-enabled Interpreter.

Interpreter supports 5 new bytecodes:
    (138 pushNewArrayBytecode)
    (140 pushRemoteTempLongBytecode)
    (141 storeRemoteTempLongBytecode)
    (142 storeAndPopRemoteTempLongBytecode)
    (143 pushClosureCopyCopiedValuesBytecode)
and loses
    (138 143 experimentalBytecode)
and gains new closure primitives
    (200 primitiveClosureCopyWithCopiedValues)
    (201 205 primitiveClosureValue)
    (206 primitiveClosureValueWithArgs)

    (210 primitiveAt)    "Compatibility with Cog StackInterpreter Context primitives"
    (211 primitiveAtPut) "Compatibility with Cog StackInterpreter Context primitives"
    (212 primitiveSize)  "Compatibility with Cog StackInterpreter Context primitives"

    (221 222 primitiveClosureValueNoContextSwitch)
210-212 are needed for eventual StackVM support sice there-in ContextPart must
use special at:, at:put: and size primitives for correct hiding of stack frames.

Compatibility for images.  Interpreter gains inst var imageFormatVersionNumber
which is initialized to the standard 6802/68000 value in Interpreter
class>>declareCVarsIn:.  If the closure creation bytecode 143 is evaluated
imageFormatVersionNumber changes to the closure value 6804/68002.  Its value
is written in snapshots.  So if 143 is used the image version stamp changes
and if not, it stays the same.   imageFormatForwardCompatibilityVersion defines
the enw values and is used in readableImage: to load both curfrent and new
(closure) format images.

VM gains a primitive unrelated to the closure primitives
		(218 primitiveDoNamedPrimitiveWithArgs)
allows the debugger to evaluate external primitives without resorting to the
horrible hack of destructively updating a method in ProtoObject (which is
non-reentrant and may mean the debugger can't debug itself).
c.f. (118 primitiveDoPrimitiveWithArgs).  This primitive uses
argumentCountOfMethodHeader: primitiveIndexOfMethodHeader: and
roomToPushNArgs: which can profitably be used elsewhere.  I'll leave
this to you.

There is also a reorganization; a much saner categorization in Interpreter.
I can't code with the essentially random current one.  Hence alas many
"source same but rev changed".

Best regards


More information about the Vm-dev mailing list