[Vm-dev] [commit][2840] CogVM source as per VMMaker.oscog-eem.577.

commits at squeakvm.org commits at squeakvm.org
Mon Jan 6 22:10:24 UTC 2014


Revision: 2840
Author:   eliot
Date:     2014-01-06 14:10:21 -0800 (Mon, 06 Jan 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.577.

Implement following primitive args to "primitive accessor depth" on
primitive failure in Spur.  Hide the primitive accessor depth for internal
named primitives in a hidden byte after the function name string, hence
preserving the ability to share generated plugin C files between SqueakV3
and Spur.

Fix assert in mapStackPages on SqueakV3.  Can't check for being married with
SqueakV3 obj mem since when compacting it moves bodies after updating pointers.

Add Scratch plugins: CameraPlugin, ScratchPlugin, WeDoPlugin, & UnicodePlugin.

Add Nicolas Cellier's bitblt speedups, reference:
	Mantis issue 7802: Fast-up BitBlt rgbAdd rule
	Mantis issue 7803: Fast-up BitBlt alpha blending rules

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
    branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c
    branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nscogsrc/vm/interp.h
    branches/Cog/nscogsrc/vm/vmCallback.h
    branches/Cog/platforms/Cross/vm/sqMemoryAccess.h
    branches/Cog/platforms/Cross/vm/sqNamedPrims.c
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/interp.h
    branches/Cog/spursrc/vm/vmCallback.h
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/spurstacksrc/vm/interp.h
    branches/Cog/spurstacksrc/vm/vmCallback.h
    branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c
    branches/Cog/src/plugins/AioPlugin/AioPlugin.c
    branches/Cog/src/plugins/AsynchFilePlugin/AsynchFilePlugin.c
    branches/Cog/src/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.c
    branches/Cog/src/plugins/BMPReadWriterPlugin/BMPReadWriterPlugin.c
    branches/Cog/src/plugins/BitBltPlugin/BitBltPlugin.c
    branches/Cog/src/plugins/BochsIA32Plugin/BochsIA32Plugin.c
    branches/Cog/src/plugins/CroquetPlugin/CroquetPlugin.c
    branches/Cog/src/plugins/DSAPrims/DSAPrims.c
    branches/Cog/src/plugins/DropPlugin/DropPlugin.c
    branches/Cog/src/plugins/FFTPlugin/FFTPlugin.c
    branches/Cog/src/plugins/FT2Plugin/FT2Plugin.c
    branches/Cog/src/plugins/FileCopyPlugin/FileCopyPlugin.c
    branches/Cog/src/plugins/FilePlugin/FilePlugin.c
    branches/Cog/src/plugins/FloatArrayPlugin/FloatArrayPlugin.c
    branches/Cog/src/plugins/FloatMathPlugin/FloatMathPlugin.c
    branches/Cog/src/plugins/GeniePlugin/GeniePlugin.c
    branches/Cog/src/plugins/HostWindowPlugin/HostWindowPlugin.c
    branches/Cog/src/plugins/IA32ABI/IA32ABI.c
    branches/Cog/src/plugins/InternetConfigPlugin/InternetConfigPlugin.c
    branches/Cog/src/plugins/JPEGReadWriter2Plugin/JPEGReadWriter2Plugin.c
    branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/src/plugins/JoystickTabletPlugin/JoystickTabletPlugin.c
    branches/Cog/src/plugins/Klatt/Klatt.c
    branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/src/plugins/LocalePlugin/LocalePlugin.c
    branches/Cog/src/plugins/MIDIPlugin/MIDIPlugin.c
    branches/Cog/src/plugins/MacMenubarPlugin/MacMenubarPlugin.c
    branches/Cog/src/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
    branches/Cog/src/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
    branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c
    branches/Cog/src/plugins/QuicktimePlugin/QuicktimePlugin.c
    branches/Cog/src/plugins/RePlugin/RePlugin.c
    branches/Cog/src/plugins/SecurityPlugin/SecurityPlugin.c
    branches/Cog/src/plugins/SerialPlugin/SerialPlugin.c
    branches/Cog/src/plugins/SocketPlugin/SocketPlugin.c
    branches/Cog/src/plugins/SoundCodecPrims/SoundCodecPrims.c
    branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c
    branches/Cog/src/plugins/SoundPlugin/SoundPlugin.c
    branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
    branches/Cog/src/plugins/SqueakSSL/SqueakSSL.c
    branches/Cog/src/plugins/StarSqueakPlugin/StarSqueakPlugin.c
    branches/Cog/src/plugins/UUIDPlugin/UUIDPlugin.c
    branches/Cog/src/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c
    branches/Cog/src/plugins/VMProfileLinuxSupportPlugin/VMProfileLinuxSupportPlugin.c
    branches/Cog/src/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c
    branches/Cog/src/plugins/Win32OSProcessPlugin/Win32OSProcessPlugin.c
    branches/Cog/src/plugins/ZipPlugin/ZipPlugin.c
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/src/vm/interp.h
    branches/Cog/src/vm/vmCallback.h
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c
    branches/Cog/stacksrc/vm/interp.h
    branches/Cog/stacksrc/vm/vmCallback.h

Added Paths:
-----------
    branches/Cog/src/plugins/CameraPlugin/
    branches/Cog/src/plugins/CameraPlugin/CameraPlugin.c
    branches/Cog/src/plugins/ScratchPlugin/
    branches/Cog/src/plugins/ScratchPlugin/ScratchPlugin.c
    branches/Cog/src/plugins/UnicodePlugin/
    branches/Cog/src/plugins/UnicodePlugin/UnicodePlugin.c
    branches/Cog/src/plugins/WeDoPlugin/
    branches/Cog/src/plugins/WeDoPlugin/WeDoPlugin.c

Property Changed:
----------------
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h

Modified: branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2014-01-06 22:10:21 UTC (rev 2840)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+	VMPluginCodeGenerator VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
    from
-	BalloonEnginePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+	BalloonEnginePlugin VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
  */
-static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
+static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd " __DATE__ ;
 
 
 
@@ -839,9 +839,9 @@
 static void * loadBBFn;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"B2DPlugin VMMaker.oscog-eem.536 (i)"
+	"B2DPlugin VMMaker.oscog-eem.576 (i)"
 #else
-	"B2DPlugin VMMaker.oscog-eem.536 (e)"
+	"B2DPlugin VMMaker.oscog-eem.576 (e)"
 #endif
 ;
 static int* objBuffer;
@@ -13970,49 +13970,49 @@
 	{"B2DPlugin", "getModuleName", (void*)getModuleName},
 	{"B2DPlugin", "initialiseModule", (void*)initialiseModule},
 	{"B2DPlugin", "moduleUnloaded", (void*)moduleUnloaded},
-	{"B2DPlugin", "primitiveAbortProcessing", (void*)primitiveAbortProcessing},
-	{"B2DPlugin", "primitiveAddActiveEdgeEntry", (void*)primitiveAddActiveEdgeEntry},
-	{"B2DPlugin", "primitiveAddBezier", (void*)primitiveAddBezier},
-	{"B2DPlugin", "primitiveAddBezierShape", (void*)primitiveAddBezierShape},
-	{"B2DPlugin", "primitiveAddBitmapFill", (void*)primitiveAddBitmapFill},
-	{"B2DPlugin", "primitiveAddCompressedShape", (void*)primitiveAddCompressedShape},
-	{"B2DPlugin", "primitiveAddGradientFill", (void*)primitiveAddGradientFill},
-	{"B2DPlugin", "primitiveAddLine", (void*)primitiveAddLine},
-	{"B2DPlugin", "primitiveAddOval", (void*)primitiveAddOval},
-	{"B2DPlugin", "primitiveAddPolygon", (void*)primitiveAddPolygon},
-	{"B2DPlugin", "primitiveAddRect", (void*)primitiveAddRect},
-	{"B2DPlugin", "primitiveChangedActiveEdgeEntry", (void*)primitiveChangedActiveEdgeEntry},
-	{"B2DPlugin", "primitiveCopyBuffer", (void*)primitiveCopyBuffer},
-	{"B2DPlugin", "primitiveDisplaySpanBuffer", (void*)primitiveDisplaySpanBuffer},
-	{"B2DPlugin", "primitiveDoProfileStats", (void*)primitiveDoProfileStats},
-	{"B2DPlugin", "primitiveFinishedProcessing", (void*)primitiveFinishedProcessing},
-	{"B2DPlugin", "primitiveGetAALevel", (void*)primitiveGetAALevel},
-	{"B2DPlugin", "primitiveGetBezierStats", (void*)primitiveGetBezierStats},
-	{"B2DPlugin", "primitiveGetClipRect", (void*)primitiveGetClipRect},
-	{"B2DPlugin", "primitiveGetCounts", (void*)primitiveGetCounts},
-	{"B2DPlugin", "primitiveGetDepth", (void*)primitiveGetDepth},
-	{"B2DPlugin", "primitiveGetFailureReason", (void*)primitiveGetFailureReason},
-	{"B2DPlugin", "primitiveGetOffset", (void*)primitiveGetOffset},
-	{"B2DPlugin", "primitiveGetTimes", (void*)primitiveGetTimes},
-	{"B2DPlugin", "primitiveInitializeBuffer", (void*)primitiveInitializeBuffer},
-	{"B2DPlugin", "primitiveInitializeProcessing", (void*)primitiveInitializeProcessing},
-	{"B2DPlugin", "primitiveMergeFillFrom", (void*)primitiveMergeFillFrom},
-	{"B2DPlugin", "primitiveNeedsFlush", (void*)primitiveNeedsFlush},
-	{"B2DPlugin", "primitiveNeedsFlushPut", (void*)primitiveNeedsFlushPut},
-	{"B2DPlugin", "primitiveNextActiveEdgeEntry", (void*)primitiveNextActiveEdgeEntry},
-	{"B2DPlugin", "primitiveNextFillEntry", (void*)primitiveNextFillEntry},
-	{"B2DPlugin", "primitiveNextGlobalEdgeEntry", (void*)primitiveNextGlobalEdgeEntry},
-	{"B2DPlugin", "primitiveRegisterExternalEdge", (void*)primitiveRegisterExternalEdge},
-	{"B2DPlugin", "primitiveRegisterExternalFill", (void*)primitiveRegisterExternalFill},
-	{"B2DPlugin", "primitiveRenderImage", (void*)primitiveRenderImage},
-	{"B2DPlugin", "primitiveRenderScanline", (void*)primitiveRenderScanline},
-	{"B2DPlugin", "primitiveSetAALevel", (void*)primitiveSetAALevel},
-	{"B2DPlugin", "primitiveSetBitBltPlugin", (void*)primitiveSetBitBltPlugin},
-	{"B2DPlugin", "primitiveSetClipRect", (void*)primitiveSetClipRect},
-	{"B2DPlugin", "primitiveSetColorTransform", (void*)primitiveSetColorTransform},
-	{"B2DPlugin", "primitiveSetDepth", (void*)primitiveSetDepth},
-	{"B2DPlugin", "primitiveSetEdgeTransform", (void*)primitiveSetEdgeTransform},
-	{"B2DPlugin", "primitiveSetOffset", (void*)primitiveSetOffset},
+	{"B2DPlugin", "primitiveAbortProcessing\000\002", (void*)primitiveAbortProcessing},
+	{"B2DPlugin", "primitiveAddActiveEdgeEntry\000\002", (void*)primitiveAddActiveEdgeEntry},
+	{"B2DPlugin", "primitiveAddBezier\000\002", (void*)primitiveAddBezier},
+	{"B2DPlugin", "primitiveAddBezierShape\000\003", (void*)primitiveAddBezierShape},
+	{"B2DPlugin", "primitiveAddBitmapFill\000\002", (void*)primitiveAddBitmapFill},
+	{"B2DPlugin", "primitiveAddCompressedShape\000\002", (void*)primitiveAddCompressedShape},
+	{"B2DPlugin", "primitiveAddGradientFill\000\002", (void*)primitiveAddGradientFill},
+	{"B2DPlugin", "primitiveAddLine\000\002", (void*)primitiveAddLine},
+	{"B2DPlugin", "primitiveAddOval\000\002", (void*)primitiveAddOval},
+	{"B2DPlugin", "primitiveAddPolygon\000\002", (void*)primitiveAddPolygon},
+	{"B2DPlugin", "primitiveAddRect\000\002", (void*)primitiveAddRect},
+	{"B2DPlugin", "primitiveChangedActiveEdgeEntry\000\002", (void*)primitiveChangedActiveEdgeEntry},
+	{"B2DPlugin", "primitiveCopyBuffer\000\001", (void*)primitiveCopyBuffer},
+	{"B2DPlugin", "primitiveDisplaySpanBuffer\000\002", (void*)primitiveDisplaySpanBuffer},
+	{"B2DPlugin", "primitiveDoProfileStats\000\000", (void*)primitiveDoProfileStats},
+	{"B2DPlugin", "primitiveFinishedProcessing\000\002", (void*)primitiveFinishedProcessing},
+	{"B2DPlugin", "primitiveGetAALevel\000\002", (void*)primitiveGetAALevel},
+	{"B2DPlugin", "primitiveGetBezierStats\000\002", (void*)primitiveGetBezierStats},
+	{"B2DPlugin", "primitiveGetClipRect\000\002", (void*)primitiveGetClipRect},
+	{"B2DPlugin", "primitiveGetCounts\000\002", (void*)primitiveGetCounts},
+	{"B2DPlugin", "primitiveGetDepth\000\002", (void*)primitiveGetDepth},
+	{"B2DPlugin", "primitiveGetFailureReason\000\002", (void*)primitiveGetFailureReason},
+	{"B2DPlugin", "primitiveGetOffset\000\002", (void*)primitiveGetOffset},
+	{"B2DPlugin", "primitiveGetTimes\000\002", (void*)primitiveGetTimes},
+	{"B2DPlugin", "primitiveInitializeBuffer\000\001", (void*)primitiveInitializeBuffer},
+	{"B2DPlugin", "primitiveInitializeProcessing\000\002", (void*)primitiveInitializeProcessing},
+	{"B2DPlugin", "primitiveMergeFillFrom\000\002", (void*)primitiveMergeFillFrom},
+	{"B2DPlugin", "primitiveNeedsFlush\000\002", (void*)primitiveNeedsFlush},
+	{"B2DPlugin", "primitiveNeedsFlushPut\000\002", (void*)primitiveNeedsFlushPut},
+	{"B2DPlugin", "primitiveNextActiveEdgeEntry\000\002", (void*)primitiveNextActiveEdgeEntry},
+	{"B2DPlugin", "primitiveNextFillEntry\000\004", (void*)primitiveNextFillEntry},
+	{"B2DPlugin", "primitiveNextGlobalEdgeEntry\000\002", (void*)primitiveNextGlobalEdgeEntry},
+	{"B2DPlugin", "primitiveRegisterExternalEdge\000\002", (void*)primitiveRegisterExternalEdge},
+	{"B2DPlugin", "primitiveRegisterExternalFill\000\002", (void*)primitiveRegisterExternalFill},
+	{"B2DPlugin", "primitiveRenderImage\000\004", (void*)primitiveRenderImage},
+	{"B2DPlugin", "primitiveRenderScanline\000\004", (void*)primitiveRenderScanline},
+	{"B2DPlugin", "primitiveSetAALevel\000\002", (void*)primitiveSetAALevel},
+	{"B2DPlugin", "primitiveSetBitBltPlugin\000\001", (void*)primitiveSetBitBltPlugin},
+	{"B2DPlugin", "primitiveSetClipRect\000\002", (void*)primitiveSetClipRect},
+	{"B2DPlugin", "primitiveSetColorTransform\000\002", (void*)primitiveSetColorTransform},
+	{"B2DPlugin", "primitiveSetDepth\000\002", (void*)primitiveSetDepth},
+	{"B2DPlugin", "primitiveSetEdgeTransform\000\002", (void*)primitiveSetEdgeTransform},
+	{"B2DPlugin", "primitiveSetOffset\000\002", (void*)primitiveSetOffset},
 	{"B2DPlugin", "setInterpreter", (void*)setInterpreter},
 	{NULL, NULL, NULL}
 };

Modified: branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c	2014-01-06 22:10:21 UTC (rev 2840)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
    from
-	BitBltSimulation VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272
+	BitBltSimulation VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
  */
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.569 uuid: 84f8b41f-92bf-41d2-9927-6c7e3d3e4272 " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd " __DATE__ ;
 
 
 
@@ -84,9 +84,9 @@
 static sqInt affectedRight(void);
 static sqInt affectedTop(void);
 static sqInt alphaBlendConstwith(sqInt sourceWord, sqInt destinationWord);
-static sqInt alphaBlendConstwithpaintMode(sqInt sourceWord, sqInt destinationWord, sqInt paintMode);
-static sqInt alphaBlendScaledwith(sqInt sourceWord, sqInt destinationWord);
-static sqInt alphaBlendwith(sqInt sourceWord, sqInt destinationWord);
+static sqInt alphaBlendConstwithpaintMode(unsigned int sourceWord, unsigned int destinationWord, sqInt paintMode);
+static sqInt alphaBlendScaledwith(unsigned int sourceWord, unsigned int destinationWord);
+static sqInt alphaBlendwith(unsigned int sourceWord, unsigned int destinationWord);
 static sqInt alphaPaintConstwith(sqInt sourceWord, sqInt destinationWord);
 static sqInt alphaSourceBlendBits16(void);
 static sqInt alphaSourceBlendBits32(void);
@@ -153,7 +153,7 @@
 static sqInt msg(char *s);
 static sqInt OLDrgbDiffwith(sqInt sourceWord, sqInt destinationWord);
 static sqInt OLDtallyIntoMapwith(sqInt sourceWord, sqInt destinationWord);
-static sqInt partitionedAddtonBitsnPartitions(unsigned int word1, unsigned int word2, sqInt nBits, sqInt nParts);
+static sqInt partitionedAddtonBitscomponentMaskcarryOverflowMask(unsigned int word1, unsigned int word2, sqInt nBits, unsigned int componentMask, unsigned int carryOverflowMask);
 static sqInt partitionedANDtonBitsnPartitions(sqInt word1, sqInt word2, sqInt nBits, sqInt nParts);
 static sqInt partitionedMaxwithnBitsnPartitions(unsigned int word1, unsigned int word2, sqInt nBits, sqInt nParts);
 static sqInt partitionedMinwithnBitsnPartitions(unsigned int word1, unsigned int word2, sqInt nBits, sqInt nParts);
@@ -174,7 +174,7 @@
 EXPORT(sqInt) primitiveWarpBits(void);
 static sqInt queryDestSurface(sqInt handle);
 static sqInt querySourceSurface(sqInt handle);
-static sqInt rgbAddwith(sqInt sourceWord, sqInt destinationWord);
+static sqInt rgbAddwith(unsigned int sourceWord, unsigned int destinationWord);
 static sqInt rgbComponentAlpha16(void);
 static sqInt rgbComponentAlpha32(void);
 static sqInt rgbComponentAlpha32with(sqInt sourceWord, sqInt destinationWord);
@@ -344,9 +344,9 @@
 };
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"BitBltPlugin VMMaker.oscog-eem.569 (i)"
+	"BitBltPlugin VMMaker.oscog-eem.576 (i)"
 #else
-	"BitBltPlugin VMMaker.oscog-eem.569 (e)"
+	"BitBltPlugin VMMaker.oscog-eem.576 (e)"
 #endif
 ;
 static sqInt noHalftone;
@@ -436,10 +436,12 @@
  */
 
 static sqInt
-alphaBlendConstwithpaintMode(sqInt sourceWord, sqInt destinationWord, sqInt paintMode)
+alphaBlendConstwithpaintMode(unsigned int sourceWord, unsigned int destinationWord, sqInt paintMode)
 {
 	sqInt bitsPerColor;
 	sqInt blend;
+	unsigned int blendAG;
+	unsigned int blendRB;
 	sqInt destPixVal;
 	sqInt destShifted;
 	sqInt i;
@@ -447,28 +449,17 @@
 	sqInt maskShifted;
 	sqInt pixBlend;
 	sqInt pixMask;
-	sqInt result;
+	unsigned int result;
 	sqInt rgbMask;
 	sqInt shift;
 	sqInt sourcePixVal;
 	sqInt sourceShifted;
-	sqInt unAlpha;
+	unsigned int unAlpha;
 
 	if (destDepth < 16) {
 		return destinationWord;
 	}
 	unAlpha = 0xFF - sourceAlpha;
-	pixMask = maskTable[destDepth];
-	if (destDepth == 16) {
-		bitsPerColor = 5;
-	}
-	else {
-		bitsPerColor = 8;
-	}
-	rgbMask = (1 << bitsPerColor) - 1;
-	maskShifted = destMask;
-	destShifted = destinationWord;
-	sourceShifted = sourceWord;
 	result = destinationWord;
 	if (destPPW == 1) {
 
@@ -478,15 +469,29 @@
 
 			/* painting a transparent pixel */
 
-			result = 0;
-			for (i = 1; i <= 4; i += 1) {
-				shift = (i - 1) * 8;
-				blend = ((((((((usqInt) sourceWord) >> shift) & rgbMask) * sourceAlpha) + (((((usqInt) destinationWord) >> shift) & rgbMask) * unAlpha)) + 0xFE) / 0xFF) & rgbMask;
-				result = result | (blend << shift);
-			}
+
+			/* blendRB red and blue */
+
+			blendRB = (((sourceWord & 16711935) * sourceAlpha) + ((destinationWord & 16711935) * unAlpha)) + 16711935;
+
+			/* blendRB alpha and green */
+
+			blendAG = ((((((usqInt) sourceWord) >> 8) & 16711935) * sourceAlpha) + (((((usqInt) destinationWord) >> 8) & 16711935) * unAlpha)) + 16711935;
+
+			/* divide by 255 */
+
+			blendRB = (((usqInt) (blendRB + ((((usqInt) (blendRB - 65537)) >> 8) & 16711935))) >> 8) & 16711935;
+			blendAG = (((usqInt) (blendAG + ((((usqInt) (blendAG - 65537)) >> 8) & 16711935))) >> 8) & 16711935;
+			result = blendRB | (blendAG << 8);
 		}
 	}
 	else {
+		pixMask = maskTable[destDepth];
+		bitsPerColor = 5;
+		rgbMask = 0x1F;
+		maskShifted = destMask;
+		destShifted = destinationWord;
+		sourceShifted = sourceWord;
 		for (j = 1; j <= destPPW; j += 1) {
 			sourcePixVal = sourceShifted & pixMask;
 			if (!(((maskShifted & pixMask) == 0)
@@ -498,12 +503,7 @@
 					blend = ((((((((usqInt) sourcePixVal) >> shift) & rgbMask) * sourceAlpha) + (((((usqInt) destPixVal) >> shift) & rgbMask) * unAlpha)) + 0xFE) / 0xFF) & rgbMask;
 					pixBlend = pixBlend | (blend << shift);
 				}
-				if (destDepth == 16) {
-					result = (result & (~(pixMask << ((j - 1) * 16)))) | (pixBlend << ((j - 1) * 16));
-				}
-				else {
-					result = pixBlend;
-				}
+				result = (result & (~(pixMask << ((j - 1) * 16)))) | (pixBlend << ((j - 1) * 16));
 			}
 			maskShifted = ((usqInt) maskShifted) >> destDepth;
 			sourceShifted = ((usqInt) sourceShifted) >> destDepth;
@@ -524,48 +524,36 @@
  */
 
 static sqInt
-alphaBlendScaledwith(sqInt sourceWord, sqInt destinationWord)
+alphaBlendScaledwith(unsigned int sourceWord, unsigned int destinationWord)
 {
-	sqInt a;
-	sqInt b;
-	sqInt dstMask;
-	sqInt g;
-	sqInt r;
-	sqInt srcMask;
-	sqInt unAlpha;
+	unsigned int ag;
+	unsigned int rb;
+	unsigned int unAlpha;
 
 
 	/* Do NOT inline this into optimized loops */
 
 
-	/* High 8 bits of source pixel */
+	/* High 8 bits of source pixel is source opacity (ARGB format) */
 
 	unAlpha = 0xFF - (((usqInt) sourceWord) >> 24);
-	dstMask = destinationWord;
-	srcMask = sourceWord;
-	b = (((usqInt) ((dstMask & 0xFF) * unAlpha)) >> 8) + (srcMask & 0xFF);
-	if (b > 0xFF) {
-		b = 0xFF;
-	}
-	dstMask = ((usqInt) dstMask) >> 8;
-	srcMask = ((usqInt) srcMask) >> 8;
-	g = (((usqInt) ((dstMask & 0xFF) * unAlpha)) >> 8) + (srcMask & 0xFF);
-	if (g > 0xFF) {
-		g = 0xFF;
-	}
-	dstMask = ((usqInt) dstMask) >> 8;
-	srcMask = ((usqInt) srcMask) >> 8;
-	r = (((usqInt) ((dstMask & 0xFF) * unAlpha)) >> 8) + (srcMask & 0xFF);
-	if (r > 0xFF) {
-		r = 0xFF;
-	}
-	dstMask = ((usqInt) dstMask) >> 8;
-	srcMask = ((usqInt) srcMask) >> 8;
-	a = (((usqInt) ((dstMask & 0xFF) * unAlpha)) >> 8) + (srcMask & 0xFF);
-	if (a > 0xFF) {
-		a = 0xFF;
-	}
-	return (((((a << 8) + r) << 8) + g) << 8) + b;
+
+	/* blend red and blue components */
+
+	rb = ((((usqInt) ((destinationWord & 16711935) * unAlpha)) >> 8) & 16711935) + (sourceWord & 16711935);
+
+	/* blend alpha and green components */
+
+	ag = ((((usqInt) (((((usqInt) destinationWord) >> 8) & 16711935) * unAlpha)) >> 8) & 16711935) + ((((usqInt) sourceWord) >> 8) & 16711935);
+
+	/* saturate red and blue components if there is a carry */
+
+	rb = (rb & 16711935) | (((usqInt) ((rb & 16777472) * 0xFF)) >> 8);
+
+	/* saturate alpha and green components if there is a carry */
+
+	ag = ((ag & 16711935) << 8) | ((ag & 16777472) * 0xFF);
+	return ag | rb;
 }
 
 
@@ -577,14 +565,13 @@
 	component. The high byte of the result will be 0. */
 
 static sqInt
-alphaBlendwith(sqInt sourceWord, sqInt destinationWord)
+alphaBlendwith(unsigned int sourceWord, unsigned int destinationWord)
 {
-	sqInt alpha;
-	sqInt blend;
-	sqInt colorMask;
-	sqInt result;
-	sqInt shift;
-	sqInt unAlpha;
+	unsigned int alpha;
+	unsigned int blendAG;
+	unsigned int blendRB;
+	unsigned int result;
+	unsigned int unAlpha;
 
 
 	/* High 8 bits of source pixel */
@@ -597,32 +584,20 @@
 		return sourceWord;
 	}
 	unAlpha = 0xFF - alpha;
-	colorMask = 0xFF;
 
-	/* red */
+	/* blend red and blue */
 
-	result = 0;
-	shift = 0;
-	blend = ((((((((usqInt) sourceWord) >> shift) & colorMask) * alpha) + (((((usqInt) destinationWord) >> shift) & colorMask) * unAlpha)) + 0xFE) / 0xFF) & colorMask;
+	blendRB = (((sourceWord & 16711935) * alpha) + ((destinationWord & 16711935) * unAlpha)) + 16711935;
 
-	/* green */
+	/* blend alpha and green */
 
-	result = result | (blend << shift);
-	shift = 8;
-	blend = ((((((((usqInt) sourceWord) >> shift) & colorMask) * alpha) + (((((usqInt) destinationWord) >> shift) & colorMask) * unAlpha)) + 0xFE) / 0xFF) & colorMask;
+	blendAG = (((((((usqInt) sourceWord) >> 8) | 0xFF0000) & 16711935) * alpha) + (((((usqInt) destinationWord) >> 8) & 16711935) * unAlpha)) + 16711935;
 
-	/* blue */
+	/* divide by 255 */
 
-	result = result | (blend << shift);
-	shift = 16;
-	blend = ((((((((usqInt) sourceWord) >> shift) & colorMask) * alpha) + (((((usqInt) destinationWord) >> shift) & colorMask) * unAlpha)) + 0xFE) / 0xFF) & colorMask;
-
-	/* alpha (pre-multiplied) */
-
-	result = result | (blend << shift);
-	shift = 24;
-	blend = ((((alpha * 0xFF) + (((((usqInt) destinationWord) >> shift) & colorMask) * unAlpha)) + 0xFE) / 0xFF) & colorMask;
-	result = result | (blend << shift);
+	blendRB = (((usqInt) (blendRB + ((((usqInt) (blendRB - 65537)) >> 8) & 16711935))) >> 8) & 16711935;
+	blendAG = (((usqInt) (blendAG + ((((usqInt) (blendAG - 65537)) >> 8) & 16711935))) >> 8) & 16711935;
+	result = blendRB | (blendAG << 8);
 	return result;
 }
 
@@ -4328,46 +4303,32 @@
 
 /*	Add word1 to word2 as nParts partitions of nBits each.
 	This is useful for packed pixels, or packed colors */
-/*	In C, most arithmetic operations answer the same bit pattern regardless of
-	the operands being signed or unsigned ints
-	(this is due to the way 2's complement numbers work). However,
-	comparisions might fail. Add the proper declaration of
-	words as unsigned int in those cases where comparisions are done (jmv)
+/*	Use unsigned int everywhere because it has a well known arithmetic model
+	without undefined behavior w.r.t. overflow and shifts
  */
 
 static sqInt
-partitionedAddtonBitsnPartitions(unsigned int word1, unsigned int word2, sqInt nBits, sqInt nParts)
+partitionedAddtonBitscomponentMaskcarryOverflowMask(unsigned int word1, unsigned int word2, sqInt nBits, unsigned int componentMask, unsigned int carryOverflowMask)
 {
-	sqInt i;
-	unsigned int mask;
-	unsigned int maskedWord1;
-	unsigned int result;
+	unsigned int carryOverflow;
 	unsigned int sum;
+	unsigned int w1;
+	unsigned int w2;
 
 
-	/* partition mask starts at the right */
+	/* mask to remove high bit of each component */
 
-	mask = maskTable[nBits];
-	result = 0;
-	for (i = 1; i <= nParts; i += 1) {
-		maskedWord1 = word1 & mask;
-		sum = maskedWord1 + (word2 & mask);
-		if ((sum <= mask)
-		 && (sum >= maskedWord1)) {
+	w1 = word1 & carryOverflowMask;
+	w2 = word2 & carryOverflowMask;
 
-			/* This is needed because in C, integer arithmetic overflows silently! (jmv) */
+	/* sum without high bit to avoid overflowing over next component */
 
-			result = result | sum;
-		}
-		else {
-			result = result | mask;
-		}
+	sum = (word1 ^ w1) + (word2 ^ w2);
 
-		/* slide left to next partition */
+	/* detect overflow condition for saturating */
 
-		mask = mask << nBits;
-	}
-	return result;
+	carryOverflow = (w1 & w2) | ((w1 | w2) & sum);
+	return ((sum ^ w1) ^ w2) | ((((usqInt) carryOverflow) >> (nBits - 1)) * componentMask);
 }
 
 
@@ -5669,25 +5630,34 @@
 }
 
 static sqInt
-rgbAddwith(sqInt sourceWord, sqInt destinationWord)
+rgbAddwith(unsigned int sourceWord, unsigned int destinationWord)
 {
+	unsigned int carryOverflowMask;
+	unsigned int componentMask;
+
 	if (destDepth < 16) {
 
 		/* Add each pixel separately */
 
-		return partitionedAddtonBitsnPartitions(sourceWord, destinationWord, destDepth, destPPW);
+		componentMask = (1 << destDepth) - 1;
+		carryOverflowMask = (0xFFFFFFFFUL / componentMask) << (destDepth - 1);
+		return partitionedAddtonBitscomponentMaskcarryOverflowMask(sourceWord, destinationWord, destDepth, componentMask, carryOverflowMask);
 	}
 	if (destDepth == 16) {
 
 		/* Add RGB components of each pixel separately */
 
-		return (partitionedAddtonBitsnPartitions(sourceWord, destinationWord, 5, 3)) + ((partitionedAddtonBitsnPartitions(((usqInt) sourceWord) >> 16, ((usqInt) destinationWord) >> 16, 5, 3)) << 16);
+		componentMask = 0x1F;
+		carryOverflowMask = 1108361744;
+		return partitionedAddtonBitscomponentMaskcarryOverflowMask(sourceWord & 2147450879, destinationWord & 2147450879, 5, componentMask, carryOverflowMask);
 	}
 	else {
 
 		/* Add RGBA components of the pixel separately */
 
-		return partitionedAddtonBitsnPartitions(sourceWord, destinationWord, 8, 4);
+		componentMask = 0xFF;
+		carryOverflowMask = 2155905152UL;
+		return partitionedAddtonBitscomponentMaskcarryOverflowMask(sourceWord, destinationWord, 8, componentMask, carryOverflowMask);
 	}
 }
 
@@ -8144,17 +8114,17 @@
 #ifdef SQUEAK_BUILTIN_PLUGIN
 
 void* BitBltPlugin_exports[][3] = {
-	{"BitBltPlugin", "copyBits", (void*)copyBits},
+	{"BitBltPlugin", "copyBits\000\001", (void*)copyBits},
 	{"BitBltPlugin", "copyBitsFromtoat", (void*)copyBitsFromtoat},
 	{"BitBltPlugin", "getModuleName", (void*)getModuleName},
 	{"BitBltPlugin", "initialiseModule", (void*)initialiseModule},
 	{"BitBltPlugin", "loadBitBltFrom", (void*)loadBitBltFrom},
 	{"BitBltPlugin", "moduleUnloaded", (void*)moduleUnloaded},
-	{"BitBltPlugin", "primitiveCopyBits", (void*)primitiveCopyBits},
-	{"BitBltPlugin", "primitiveDisplayString", (void*)primitiveDisplayString},
-	{"BitBltPlugin", "primitiveDrawLoop", (void*)primitiveDrawLoop},
-	{"BitBltPlugin", "primitivePixelValueAt", (void*)primitivePixelValueAt},
-	{"BitBltPlugin", "primitiveWarpBits", (void*)primitiveWarpBits},
+	{"BitBltPlugin", "primitiveCopyBits\000\003", (void*)primitiveCopyBits},
+	{"BitBltPlugin", "primitiveDisplayString\000\003", (void*)primitiveDisplayString},
+	{"BitBltPlugin", "primitiveDrawLoop\000\003", (void*)primitiveDrawLoop},
+	{"BitBltPlugin", "primitivePixelValueAt\000\002", (void*)primitivePixelValueAt},
+	{"BitBltPlugin", "primitiveWarpBits\000\003", (void*)primitiveWarpBits},
 	{"BitBltPlugin", "setInterpreter", (void*)setInterpreter},
 	{NULL, NULL, NULL}
 };

Modified: branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c	2014-01-06 22:10:21 UTC (rev 2840)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+	VMPluginCodeGenerator VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
    from
-	FloatArrayPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
+	FloatArrayPlugin VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
  */
-static char __buildInfo[] = "FloatArrayPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
+static char __buildInfo[] = "FloatArrayPlugin VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd " __DATE__ ;
 
 
 
@@ -112,9 +112,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FloatArrayPlugin VMMaker.oscog-eem.536 (i)"
+	"FloatArrayPlugin VMMaker.oscog-eem.576 (i)"
 #else
-	"FloatArrayPlugin VMMaker.oscog-eem.536 (e)"
+	"FloatArrayPlugin VMMaker.oscog-eem.576 (e)"
 #endif
 ;
 
@@ -743,22 +743,22 @@
 
 void* FloatArrayPlugin_exports[][3] = {
 	{"FloatArrayPlugin", "getModuleName", (void*)getModuleName},
-	{"FloatArrayPlugin", "primitiveAddFloatArray", (void*)primitiveAddFloatArray},
-	{"FloatArrayPlugin", "primitiveAddScalar", (void*)primitiveAddScalar},
-	{"FloatArrayPlugin", "primitiveAt", (void*)primitiveAt},
-	{"FloatArrayPlugin", "primitiveAtPut", (void*)primitiveAtPut},
-	{"FloatArrayPlugin", "primitiveDivFloatArray", (void*)primitiveDivFloatArray},
-	{"FloatArrayPlugin", "primitiveDivScalar", (void*)primitiveDivScalar},
-	{"FloatArrayPlugin", "primitiveDotProduct", (void*)primitiveDotProduct},
-	{"FloatArrayPlugin", "primitiveEqual", (void*)primitiveEqual},
-	{"FloatArrayPlugin", "primitiveHashArray", (void*)primitiveHashArray},
-	{"FloatArrayPlugin", "primitiveLength", (void*)primitiveLength},
-	{"FloatArrayPlugin", "primitiveMulFloatArray", (void*)primitiveMulFloatArray},
-	{"FloatArrayPlugin", "primitiveMulScalar", (void*)primitiveMulScalar},
-	{"FloatArrayPlugin", "primitiveNormalize", (void*)primitiveNormalize},
-	{"FloatArrayPlugin", "primitiveSubFloatArray", (void*)primitiveSubFloatArray},
-	{"FloatArrayPlugin", "primitiveSubScalar", (void*)primitiveSubScalar},
-	{"FloatArrayPlugin", "primitiveSum", (void*)primitiveSum},
+	{"FloatArrayPlugin", "primitiveAddFloatArray\000\001", (void*)primitiveAddFloatArray},
+	{"FloatArrayPlugin", "primitiveAddScalar\000\001", (void*)primitiveAddScalar},
+	{"FloatArrayPlugin", "primitiveAt\000\001", (void*)primitiveAt},
+	{"FloatArrayPlugin", "primitiveAtPut\000\001", (void*)primitiveAtPut},
+	{"FloatArrayPlugin", "primitiveDivFloatArray\000\001", (void*)primitiveDivFloatArray},
+	{"FloatArrayPlugin", "primitiveDivScalar\000\001", (void*)primitiveDivScalar},
+	{"FloatArrayPlugin", "primitiveDotProduct\000\001", (void*)primitiveDotProduct},
+	{"FloatArrayPlugin", "primitiveEqual\000\001", (void*)primitiveEqual},
+	{"FloatArrayPlugin", "primitiveHashArray\000\001", (void*)primitiveHashArray},
+	{"FloatArrayPlugin", "primitiveLength\000\001", (void*)primitiveLength},
+	{"FloatArrayPlugin", "primitiveMulFloatArray\000\001", (void*)primitiveMulFloatArray},
+	{"FloatArrayPlugin", "primitiveMulScalar\000\001", (void*)primitiveMulScalar},
+	{"FloatArrayPlugin", "primitiveNormalize\000\001", (void*)primitiveNormalize},
+	{"FloatArrayPlugin", "primitiveSubFloatArray\000\001", (void*)primitiveSubFloatArray},
+	{"FloatArrayPlugin", "primitiveSubScalar\000\001", (void*)primitiveSubScalar},
+	{"FloatArrayPlugin", "primitiveSum\000\001", (void*)primitiveSum},
 	{"FloatArrayPlugin", "setInterpreter", (void*)setInterpreter},
 	{NULL, NULL, NULL}
 };

Modified: branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/plugins/Matrix2x3Plugin/Matrix2x3Plugin.c	2014-01-06 22:10:21 UTC (rev 2840)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
    from
-	Matrix2x3Plugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	Matrix2x3Plugin VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd
  */
-static char __buildInfo[] = "Matrix2x3Plugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "Matrix2x3Plugin VMMaker.oscog-eem.576 uuid: f4b652dc-67bc-4cf3-8b62-74bcbcbf01cd " __DATE__ ;
 
 
 
@@ -117,9 +117,9 @@
 static double m23ResultY;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"Matrix2x3Plugin VMMaker.oscog-eem.517 (i)"
+	"Matrix2x3Plugin VMMaker.oscog-eem.576 (i)"
 #else
-	"Matrix2x3Plugin VMMaker.oscog-eem.517 (e)"
+	"Matrix2x3Plugin VMMaker.oscog-eem.576 (e)"
 #endif
 ;
 
@@ -813,13 +813,13 @@
 
 void* Matrix2x3Plugin_exports[][3] = {
 	{"Matrix2x3Plugin", "getModuleName", (void*)getModuleName},
-	{"Matrix2x3Plugin", "primitiveComposeMatrix", (void*)primitiveComposeMatrix},
-	{"Matrix2x3Plugin", "primitiveInvertPoint", (void*)primitiveInvertPoint},
-	{"Matrix2x3Plugin", "primitiveInvertRectInto", (void*)primitiveInvertRectInto},
-	{"Matrix2x3Plugin", "primitiveIsIdentity", (void*)primitiveIsIdentity},
-	{"Matrix2x3Plugin", "primitiveIsPureTranslation", (void*)primitiveIsPureTranslation},
-	{"Matrix2x3Plugin", "primitiveTransformPoint", (void*)primitiveTransformPoint},
-	{"Matrix2x3Plugin", "primitiveTransformRectInto", (void*)primitiveTransformRectInto},
+	{"Matrix2x3Plugin", "primitiveComposeMatrix\000\000", (void*)primitiveComposeMatrix},
+	{"Matrix2x3Plugin", "primitiveInvertPoint\000\001", (void*)primitiveInvertPoint},
+	{"Matrix2x3Plugin", "primitiveInvertRectInto\000\002", (void*)primitiveInvertRectInto},
+	{"Matrix2x3Plugin", "primitiveIsIdentity\000\000", (void*)primitiveIsIdentity},
+	{"Matrix2x3Plugin", "primitiveIsPureTranslation\000\000", (void*)primitiveIsPureTranslation},
+	{"Matrix2x3Plugin", "primitiveTransformPoint\000\001", (void*)primitiveTransformPoint},
+	{"Matrix2x3Plugin", "primitiveTransformRectInto\000\002", (void*)primitiveTransformRectInto},
 	{"Matrix2x3Plugin", "setInterpreter", (void*)setInterpreter},
 	{NULL, NULL, NULL}
 };

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-01-06 22:10:21 UTC (rev 2840)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7
    from
-	CoInterpreter VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8
+	CoInterpreter VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1143,7 +1143,7 @@
 static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
 static sqInt roomToPushNArgs(sqInt n);
 static void runLeakCheckerForFullGC(sqInt fullGCFlag);
-static sqInt safeObjectAfter(sqInt oop);
+static usqInt safeObjectAfter(sqInt oop);
 static sqInt safePrintStringOf(sqInt oop);
 usqInt scavengeThresholdAddress(void);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -1273,8 +1273,8 @@
 _iss sqInt argumentCount;
 _iss usqInt freeStart;
 _iss sqInt nilObj;
-_iss sqInt messageSelector;
 _iss usqInt newMethod;
+_iss sqInt messageSelector;
 _iss usqInt youngStart;
 _iss StackPage * pages;
 _iss char * stackBasePlus1;
@@ -1328,6 +1328,7 @@
 _iss sqInt statSweepCount;
 _iss sqInt cogCodeSize;
 _iss usqInt compEnd;
+_iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
 _iss sqInt metaclassNumSlots;
 _iss sqInt pendingFinalizationSignals;
@@ -1343,7 +1344,6 @@
 _iss sqInt statMkFwdCount;
 _iss sqInt tenuringThreshold;
 _iss sqInt thisClassIndex;
-_iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt forceTenureFlag;
 _iss sqInt fullScreenFlag;
 _iss sqInt interruptPending;
@@ -1449,8 +1449,8 @@
 sqInt suppressHeartbeatFlag;
 static const sqInt headerTypeBytes[] = {
 		8, 4, 0, 0
-	}
-;
+	};
+static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 577 */])(void) = {
 	/* 0 */ (void (*)(void))0,
 	/* 1 */ primitiveAdd,
@@ -2029,8 +2029,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.570";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.577";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4824,6 +4823,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l307;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4841,7 +4841,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					/* return self */
+					null;
 				l307:	/* end baseFrameReturn */;
 					goto l304;
 				}
@@ -5306,6 +5306,7 @@
 					/* begin initPrimCall */
 					GIV(primFailCode) = 0;
 					dispatchFunctionPointer(primitiveFunctionPointer);
+					
 					if (FailImbalancedPrimitives
 					 && ((!GIV(primFailCode))
 					 && ((GIV(framePointer) == savedFramePointer)
@@ -5666,6 +5667,7 @@
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
 					}
+					null;
 					goto l4;
 				}
 				if (opType == 3) {
@@ -5675,6 +5677,7 @@
 					assert(GIV(method) == (iframeMethod(localFP)));
 					object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object);
+					null;
 					goto l4;
 				}
 				if (opType == 4) {
@@ -5688,6 +5691,7 @@
 					object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object2);
 
+					null;
 					goto l4;
 				}
 				top = longAtPointer(localSP);
@@ -19066,7 +19070,7 @@
 		return -1;
 	}
 	dataSize = GIV(endOfMemory) - (startOfMemory());
-	result = sqImageFileWrite(pointerForOop(memory), sizeof(unsigned char), dataSize, f);
+	result = sqImageFileWrite(pointerForOop(memory()), sizeof(unsigned char), dataSize, f);
 	sqImageFileClose(f);
 	return result;
 }
@@ -19346,14 +19350,7 @@
 	assert((((usqInt) ((formatOfClass(compactClassAt(compactClassIndex))) & 393216)) >> 9) == 0);
 	flag("sizeLowBits");
 	byteSize = (numSlots << (ShiftForWord + (ShiftForWord - 2))) + BaseHeaderSize;
-	if ((BytesPerWord == 8)
-	 && ((objFormat >= 6)
-	 && ((numSlots & 1) != 0))) {
-
-		/* extra low bit (4) for 64-bit VM goes in 4-bit (betw hdr bits and sizeBits) */
-
-		header1 = header1 | 4;
-	}
+	
 	if (byteSize > 0xFF) {
 
 		/* requires size header word/full header */
@@ -23723,17 +23720,15 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
-    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    sqInt next;
+    usqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
-    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -23744,21 +23739,7 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			/* begin objectAfter: */
-			if (!(asserta(oopisLessThan(oop, GIV(freeStart))))) {
-				error("no objects after the end of memory");
-			}
-			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
-				sz2 = (longAt(oop)) & AllButTypeMask;
-			}
-			else {
-				/* begin sizeBitsOf: */
-				header3 = longAt(oop);
-				sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
-					? (longAt(oop - (BytesPerWord * 2))) & LongSizeMask
-					: header3 & SizeMask);
-			}
-			next = (oop + sz2) + (headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
+			next = ((sqInt) (objectAfter(oop)));
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23773,7 +23754,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
+		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -23827,18 +23808,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header4 = longAt(newFreeChunk);
-		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
+		header3 = longAt(newFreeChunk);
+		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header4 & SizeMask);
+			: header3 & SizeMask);
 	}
-	next = ((newFreeChunk + sz3) >= GIV(freeStart)
+	next = ((newFreeChunk + sz2) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
+		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -24658,6 +24639,7 @@
 			/* begin initPrimCall */
 			GIV(primFailCode) = 0;
 			dispatchFunctionPointer(primitiveFunctionPointer);
+			
 			if (FailImbalancedPrimitives
 			 && ((!GIV(primFailCode))
 			 && ((GIV(framePointer) == savedFramePointer)
@@ -27990,16 +27972,7 @@
 			if (fmt <= 4) {
 				if (fmt >= 3) {
 					if (fmt == 4) {
-						if (0
-						 && (GIV(weakRootCount) >= 0)) {
-
-							/* And remember as weak root */
-
-							if (!(((GIV(weakRootCount) += 1)) <= WeakRootTableSize)) {
-								error("weakRoots table overflow");
-							}
-							GIV(weakRoots)[GIV(weakRootCount)] = oop1;
-						}
+						;
 						/* begin nonWeakFieldsOf: */
 						assert(isWeakNonImm(oop1));
 						class = (((ccIndex = (((usqInt) (longAt(oop1))) >> 12) & 0x1F)) == 0
@@ -29840,14 +29813,7 @@
 		return value;
 	}
 	else {
-		if (0
-		 && ((oop & 1))) {
-			/* begin primitiveFail */
-			if (!GIV(primFailCode)) {
-				GIV(primFailCode) = 1;
-			}
-			return 0;
-		}
+		;
 	}
 	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
 	assert(!((oop & 1)));
@@ -34658,6 +34624,7 @@
 	/* begin initPrimCall */
 	GIV(primFailCode) = 0;
 	dispatchFunctionPointer(primitiveFunctionPointer);
+	
 	if (FailImbalancedPrimitives
 	 && ((!GIV(primFailCode))
 	 && ((GIV(framePointer) == savedFramePointer)
@@ -35217,9 +35184,9 @@
 
 /*	Call an external primitive. External primitive methods first literals are
 	an array of
-	* The module name (String | Symbol) 
-	* The function name (String | Symbol) 
-	* The session ID (SmallInteger) [OBSOLETE] 
+	* The module name (String | Symbol)
+	* The function name (String | Symbol)
+	* The session ID (SmallInteger) [OBSOLETE] (or in Spur, the accessorDepth)
 	* The function index (Integer) in the externalPrimitiveTable
 	For fast interpreter dispatch in subsequent invocations the
 	primitiveFunctionPointer in the method cache is rewritten, either to the
@@ -35228,7 +35195,7 @@
 	method stays in
 	the cache. The cache rewrite relies on lastMethodCacheProbeWrite which is
 	set in
-	addNewMethodToCache:. 
+	addNewMethodToCache:.
 	Now that the VM flushes function addresses from its tables, the session ID
 	is obsolete,
 	but it is kept for backward compatibility. Also, a failed lookup is
@@ -35243,6 +35210,7 @@
 static void
 primitiveExternalCall(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt accessorDepth;
     void (*addr)();
     sqInt fmt;
     sqInt fmt1;
@@ -35251,12 +35219,14 @@
     sqInt header;
     sqInt header1;
     sqInt i;
+    sqInt i1;
     sqInt index;
     sqInt lit;
     sqInt moduleLength;
     sqInt moduleName;
     sqInt sz;
     sqInt sz1;
+    sqInt val;
 
 
 	/* Fetch the first literal of the method */
@@ -35329,12 +35299,12 @@
 		sz -= header & Size4Bit;
 		if (fmt <= 4) {
 			moduleLength = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
-			goto l2;
+			goto l3;
 		}
 		moduleLength = (fmt < 8
 			? ((usqInt) (sz - BaseHeaderSize)) >> 2
 			: (sz - BaseHeaderSize) - (fmt & 3));
-	l2:	/* end lengthOf:baseHeader:format: */;
+	l3:	/* end lengthOf:baseHeader:format: */;
 	}
 	functionName = longAt((lit + BaseHeaderSize) + (1 << ShiftForWord));
 	if (!(((functionName & 1) == 0)
@@ -35354,12 +35324,12 @@
 	sz1 -= header1 & Size4Bit;
 	if (fmt1 <= 4) {
 		functionLength = ((usqInt) (sz1 - BaseHeaderSize)) >> ShiftForWord;
-		goto l3;
+		goto l4;
 	}
 	functionLength = (fmt1 < 8
 		? ((usqInt) (sz1 - BaseHeaderSize)) >> 2
 		: (sz1 - BaseHeaderSize) - (fmt1 & 3));
-l3:	/* end lengthOf:baseHeader:format: */;
+l4:	/* end lengthOf:baseHeader:format: */;
 	addr = ioLoadExternalFunctionOfLengthFromModuleOfLength(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength);
 	if (addr == 0) {
 		index = -1;
@@ -35369,16 +35339,17 @@
 		/* add the function to the external primitive table */
 
 		/* begin addToExternalPrimitiveTable: */
-		for (i = GIV(externalPrimitiveTableFirstFreeIndex); i < MaxExternalPrimitiveTableSize; i += 1) {
-			if ((externalPrimitiveTable[i]) == 0) {
-				externalPrimitiveTable[i] = addr;
-				index = (GIV(externalPrimitiveTableFirstFreeIndex) = i + 1);
-				goto l1;
+		for (i1 = GIV(externalPrimitiveTableFirstFreeIndex); i1 < MaxExternalPrimitiveTableSize; i1 += 1) {
+			if ((externalPrimitiveTable[i1]) == 0) {
+				externalPrimitiveTable[i1] = addr;
+				index = (GIV(externalPrimitiveTableFirstFreeIndex) = i1 + 1);
+				goto l2;
 			}
 		}
 		index = 0;
-	l1:	/* end addToExternalPrimitiveTable: */;
+	l2:	/* end addToExternalPrimitiveTable: */;
 	}
+
 	longAtput((lit + BaseHeaderSize) + (3 << ShiftForWord), ((index << 1) | 1));
 	if (index >= 0) {
 		rewriteMethodCacheEntryForExternalPrimitiveToFunction(addr);
@@ -35390,8 +35361,8 @@
 		/* Otherwise void the primitive function and fail */
 
 		rewriteMethodCacheEntryForExternalPrimitiveToFunction(0);
-		(GIV(primFailCode) = PrimErrNotFound);
-		return;
+		assert((fetchPointerofObject(2, lit)) == ConstZero);
+		GIV(primFailCode) = PrimErrNotFound;
 	}
 }
 
@@ -47183,8 +47154,7 @@
 		"?", "m", "i", "callbackEnter", "callbackLeave", "enterCritical",
 		"exitCritical", "resume", "signal", "suspend", "wait", "yield", "eventcheck",
 		"threadsched", "ownVM", "bindToThread", "switchIfNecessary"
-	}
-;
+	};
 
 	intOrClass = GIV(traceLog)[i];
 	selectorMethodOrProcess = GIV(traceLog)[i + 1];
@@ -49205,10 +49175,7 @@
 		invalidCompactClassError("Float");
 	}
 	/* begin checkCompactIndex:isClass:named: */
-	if ((ClassBlockClosureCompactIndex != 0)
-	 && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassBlockClosure << ShiftForWord))) != (longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ClassBlockClosureCompactIndex - 1) << ShiftForWord))))) {
-		invalidCompactClassError("BlockClosure");
-	}
+	;
 	/* begin checkCompactIndex:isClass:named: */
 	if ((ClassMethodContextCompactIndex != 0)
 	 && ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMethodContext << ShiftForWord))) != (longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ClassMethodContextCompactIndex - 1) << ShiftForWord))))) {
@@ -50046,7 +50013,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static sqInt
+static usqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;
@@ -51568,7 +51535,10 @@
 
 
 /*	Invoke a normal (non-quick) primitive.
-	Called under the assumption that primFunctionPtr has been preloaded */
+	Called under the assumption that primFunctionPointer has been preloaded. */
+/*	Invoke a normal (non-quick) primitive.
+	Called under the assumption that primFunctionPointer has been preloaded.
+	Override to log primitive. */
 
 static sqInt
 slowPrimitiveResponse(void)
@@ -51589,6 +51559,7 @@
 	/* begin initPrimCall */
 	GIV(primFailCode) = 0;
 	dispatchFunctionPointer(primitiveFunctionPointer);
+	
 	if (FailImbalancedPrimitives
 	 && ((!GIV(primFailCode))
 	 && ((GIV(framePointer) == savedFramePointer)

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-01-06 22:10:21 UTC (rev 2840)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-01-04 19:09:42 UTC (rev 2839)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-01-06 22:10:21 UTC (rev 2840)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7
    from
-	CoInterpreter VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8
+	CoInterpreter VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.570 uuid: 193cb05d-73a5-4efa-833f-126ca02695d8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.577 uuid: 8788f091-6817-480e-9bda-13ae360eeeb7 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1146,7 +1146,7 @@
 static void rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
 static sqInt roomToPushNArgs(sqInt n);
 static void runLeakCheckerForFullGC(sqInt fullGCFlag);
-static sqInt safeObjectAfter(sqInt oop);
+static usqInt safeObjectAfter(sqInt oop);
 static sqInt safePrintStringOf(sqInt oop);
 usqInt scavengeThresholdAddress(void);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -1276,8 +1276,8 @@
 _iss sqInt argumentCount;
 _iss usqInt freeStart;
 _iss sqInt nilObj;
-_iss sqInt messageSelector;
 _iss usqInt newMethod;
+_iss sqInt messageSelector;
 _iss usqInt youngStart;
 _iss StackPage * pages;
 _iss char * stackBasePlus1;
@@ -1331,6 +1331,7 @@
 _iss sqInt statSweepCount;
 _iss sqInt cogCodeSize;
 _iss usqInt compEnd;
+_iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
 _iss sqInt metaclassNumSlots;
 _iss sqInt pendingFinalizationSignals;
@@ -1346,7 +1347,6 @@
 _iss sqInt statMkFwdCount;
 _iss sqInt tenuringThreshold;
 _iss sqInt thisClassIndex;
-_iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt forceTenureFlag;
 _iss sqInt fullScreenFlag;
 _iss sqInt interruptPending;
@@ -1452,8 +1452,8 @@
 sqInt suppressHeartbeatFlag;
 static const sqInt headerTypeBytes[] = {
 		8, 4, 0, 0
-	}
-;
+	};
+static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 577 */])(void) = {
 	/* 0 */ (void (*)(void))0,
 	/* 1 */ primitiveAdd,
@@ -2032,8 +2032,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.570";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.577";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4833,6 +4832,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l307;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4850,7 +4850,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					/* return self */
+					null;
 				l307:	/* end baseFrameReturn */;
 					goto l304;
 				}
@@ -5315,6 +5315,7 @@
 					/* begin initPrimCall */
 					GIV(primFailCode) = 0;
 					dispatchFunctionPointer(primitiveFunctionPointer);
+					
 					if (FailImbalancedPrimitives
 					 && ((!GIV(primFailCode))
 					 && ((GIV(framePointer) == savedFramePointer)
@@ -5675,6 +5676,7 @@
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
 					}
+					null;
 					goto l4;
 				}
 				if (opType == 3) {
@@ -5684,6 +5686,7 @@
 					assert(GIV(method) == (iframeMethod(localFP)));
 					object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object);
+					null;
 					goto l4;
 				}
 				if (opType == 4) {
@@ -5697,6 +5700,7 @@
 					object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object2);
 
+					null;
 					goto l4;
 				}
 				top = longAtPointer(localSP);
@@ -19075,7 +19079,7 @@
 		return -1;
 	}
 	dataSize = GIV(endOfMemory) - (startOfMemory());
-	result = sqImageFileWrite(pointerForOop(memory), sizeof(unsigned char), dataSize, f);
+	result = sqImageFileWrite(pointerForOop(memory()), sizeof(unsigned char), dataSize, f);
 	sqImageFileClose(f);
 	return result;
 }
@@ -19355,14 +19359,7 @@
 	assert((((usqInt) ((formatOfClass(compactClassAt(compactClassIndex))) & 393216)) >> 9) == 0);
 	flag("sizeLowBits");
 	byteSize = (numSlots << (ShiftForWord + (ShiftForWord - 2))) + BaseHeaderSize;
-	if ((BytesPerWord == 8)
-	 && ((objFormat >= 6)
-	 && ((numSlots & 1) != 0))) {
-
-		/* extra low bit (4) for 64-bit VM goes in 4-bit (betw hdr bits and sizeBits) */
-
-		header1 = header1 | 4;
-	}
+	
 	if (byteSize > 0xFF) {
 
 		/* requires size header word/full header */
@@ -23732,17 +23729,15 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
-    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    sqInt next;
+    usqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list