[Vm-dev] [commit][2818] Cog VM source as per VMMaker.oscog-eem.536.

commits at squeakvm.org commits at squeakvm.org
Thu Dec 5 20:14:53 UTC 2013


Revision: 2818
Author:   eliot
Date:     2013-12-05 12:14:48 -0800 (Thu, 05 Dec 2013)
Log Message:
-----------
Cog VM source as per VMMaker.oscog-eem.536.

All changes internal (no external bug fixes).
Most important change is generation of to:do: loops.

Add printCogMethodsWithPrimitive: as api.

Change printAllStacks to enumerate heap for suspended processes last, and
to use class indices on Spur, and to follow potentially forwarded fields.

Simplify primitiveShortAtPut (isWordsOrBytes: filters-out immediates anyway).

Fix type of theIP in CoInterpreter>>makeBaseFrameFor: which was
causing mis-identification of machine-code pcs in contexts.

Refactor validStackPageBaseFrames into validStackPageBaseFrame:
and use latter in makeBaseFrameFor:'s asserts to speed-up debug VM.

Indicate ceReturnToInterpreterPC in CoInterpreter frame printing.

Make CogMethodZone>>freeStart a macro to give unfettered
access to the memory manager's freeStart in gdb.

Add several missing printing methods to SpurMemMgr.

Make printMethodCache translate so as to include it in the real VM.

Refactor compactCompiledCode: to compactCompiledCode to get
the null header initialized correctly.

Implement following of potentially forwarded literal variables in the Cogit.

Fix several SpurMemoryManager bugs with compaction, segment management, etc.

Fix Spur machine-code indexing and instantiation primitives and access
scavengeThreshold as a constant.

Fix evolutiuon of send site linked to closed PIC into site linked to open PIC
to enforce invariant that cache tags of sites linked to open PICs are selectors;
this for checkIfValidObjectRef:pc:cogMethod:'s cache tag checks.

Simplify the setHeapBase:memoryLimit:endOfMemory: logic in
CoInterpreter>>readImageFromFile:HeapSize:StartingAt:.

Slang:
Fix to:do: loops with unsigned limits hence if limit is unsigned and zero,
avoiding the overflow resulting from i <= (limit - 1).

Fix implicit typing of variables assigned the result of an <api> method.

Reverse the ill-considered decision to output wordSize as
BytesPerWord in VMMaker.oscog-eem.363.

Fix Integer << Integer to cast to 64-bits if the shift overflows 32-bits.

Make sure dead code is not removed from plugin sources (if they're
shared they can't be prematurely optimized).

Do a better job at generating integer literals for flags.

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
    branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
    branches/Cog/nscogsrc/plugins/DSAPrims/DSAPrims.c
    branches/Cog/nscogsrc/plugins/DropPlugin/DropPlugin.c
    branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c
    branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c
    branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/nscogsrc/plugins/SecurityPlugin/SecurityPlugin.c
    branches/Cog/nscogsrc/plugins/SqueakSSL/SqueakSSL.c
    branches/Cog/nscogsrc/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c
    branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c
    branches/Cog/nscogsrc/vm/cogit.c
    branches/Cog/nscogsrc/vm/cogit.h
    branches/Cog/nscogsrc/vm/cogmethod.h
    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/spursrc/vm/cogit.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogmethod.h
    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/B2DPlugin/B2DPlugin.c
    branches/Cog/src/plugins/B3DAcceleratorPlugin/B3DAcceleratorPlugin.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/FilePlugin/FilePlugin.c
    branches/Cog/src/plugins/FloatArrayPlugin/FloatArrayPlugin.c
    branches/Cog/src/plugins/GdbARMPlugin/GdbARMPlugin.c
    branches/Cog/src/plugins/InternetConfigPlugin/InternetConfigPlugin.c
    branches/Cog/src/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
    branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/src/plugins/MacMenubarPlugin/MacMenubarPlugin.c
    branches/Cog/src/plugins/Mpeg3Plugin/Mpeg3Plugin.c
    branches/Cog/src/plugins/SecurityPlugin/SecurityPlugin.c
    branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.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/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c
    branches/Cog/src/plugins/ZipPlugin/ZipPlugin.c
    branches/Cog/src/vm/cogit.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogmethod.h
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/gcc3x-cointerp.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/scripts/lastCheckin

Property Changed:
----------------
    branches/Cog/macbuild/SqueakSSL/
    branches/Cog/nscogbuild/macbuild/SqueakSSL/
    branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
    branches/Cog/spurcogbuild/macbuild/BochsIA32Plugin/
    branches/Cog/spurcogbuild/macbuild/CroquetPlugin/
    branches/Cog/spurcogbuild/macbuild/FloatArrayPlugin/
    branches/Cog/spurcogbuild/macbuild/FloatMathPlugin/
    branches/Cog/spurcogbuild/macbuild/Mpeg3Plugin/
    branches/Cog/spurcogbuild/macbuild/SqueakFFIPrims/
    branches/Cog/spurcogbuild/macbuild/SqueakMTFFIPrims/
    branches/Cog/spurcogbuild/macbuild/SqueakSSL/
    branches/Cog/spurcogbuild/macbuild/UnixOSProcessPlugin/
    branches/Cog/spurstackbuild/macbuild/CroquetPlugin/
    branches/Cog/spurstackbuild/macbuild/FloatArrayPlugin/
    branches/Cog/spurstackbuild/macbuild/FloatMathPlugin/
    branches/Cog/spurstackbuild/macbuild/Mpeg3Plugin/
    branches/Cog/spurstackbuild/macbuild/SqueakFFIPrims/
    branches/Cog/spurstackbuild/macbuild/UnixOSProcessPlugin/


Property changes on: branches/Cog/macbuild/SqueakSSL
___________________________________________________________________
Added: svn:ignore
   + build



Property changes on: branches/Cog/nscogbuild/macbuild/SqueakSSL
___________________________________________________________________
Added: svn:ignore
   + build


Modified: branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/B2DPlugin/B2DPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	BalloonEnginePlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	BalloonEnginePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "BalloonEnginePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -839,9 +839,9 @@
 static void * loadBBFn;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"B2DPlugin VMMaker.oscog-eem.517 (i)"
+	"B2DPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"B2DPlugin VMMaker.oscog-eem.517 (e)"
+	"B2DPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static int* objBuffer;
@@ -1232,12 +1232,12 @@
 	/* begin colormapOf: */
 	cm = (objBuffer + fill) + GBColormapOffset;
 	if ((workBuffer[GWHasColorTransform]) != 0) {
-		for (i = 0; i <= (cmSize - 1); i += 1) {
+		for (i = 0; i < cmSize; i += 1) {
 			cm[i] = (transformColor(cmBits[i]));
 		}
 	}
 	else {
-		for (i = 0; i <= (cmSize - 1); i += 1) {
+		for (i = 0; i < cmSize; i += 1) {
 			cm[i] = (cmBits[i]);
 		}
 	}
@@ -1300,12 +1300,12 @@
 	/* begin gradientRampOf: */
 	rampPtr = (objBuffer + fill) + GFRampOffset;
 	if ((workBuffer[GWHasColorTransform]) != 0) {
-		for (i = 0; i <= (rampWidth - 1); i += 1) {
+		for (i = 0; i < rampWidth; i += 1) {
 			rampPtr[i] = (transformColor(ramp[i]));
 		}
 	}
 	else {
-		for (i = 0; i <= (rampWidth - 1); i += 1) {
+		for (i = 0; i < rampWidth; i += 1) {
 			rampPtr[i] = (ramp[i]);
 		}
 	}
@@ -1753,7 +1753,7 @@
 	length = slotSizeOf(fillList);
 	fillPtr = firstIndexableField(fillList);
 	nFills = 0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		runLength = ((usqInt) ((((int *) fillPtr))[i]) >> 16);
 		runValue = ((((int *) fillPtr))[i]) & 0xFFFF;
 		if (!((runValue >= 0)
@@ -1784,7 +1784,7 @@
 	}
 	length = slotSizeOf(indexList);
 	fillPtr = firstIndexableField(indexList);
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 
 		/* Make sure the fill is okay */
 
@@ -1811,7 +1811,7 @@
 	length = slotSizeOf(lineWidthList);
 	ptr = firstIndexableField(lineWidthList);
 	nItems = 0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		runLength = ((usqInt) ((((int *) ptr))[i]) >> 16);
 		nItems += runLength;
 	}
@@ -5777,7 +5777,7 @@
 	}
 	x0 = (point1Get())[0];
 	y0 = (point1Get())[1];
-	for (i = 1; i <= (nPoints - 1); i += 1) {
+	for (i = 1; i < nPoints; i += 1) {
 		loadPointfrom(point1Get(), fetchPointerofObject(i, points));
 		if (failed()) {
 			return null;
@@ -5927,7 +5927,7 @@
     sqInt y4;
     sqInt y5;
 
-	for (i = 0; i <= (nSegments - 1); i += 1) {
+	for (i = 0; i < nSegments; i += 1) {
 		pointOop = fetchPointerofObject(i * 3, points);
 		loadPointfrom(point1Get(), pointOop);
 		pointOop = fetchPointerofObject((i * 3) + 1, points);
@@ -6079,7 +6079,7 @@
     sqInt i;
     sqInt value;
 
-	for (i = 0; i <= (n - 1); i += 1) {
+	for (i = 0; i < n; i += 1) {
 		value = fetchPointerofObject(i, transformOop);
 		if (!((isIntegerObject(value))
 			 || (isFloatObject(value)))) {
@@ -6220,12 +6220,12 @@
 	/* begin colormapOf: */
 	cm = (objBuffer + fill) + GBColormapOffset;
 	if ((workBuffer[GWHasColorTransform]) != 0) {
-		for (i = 0; i <= (cmSize - 1); i += 1) {
+		for (i = 0; i < cmSize; i += 1) {
 			cm[i] = (transformColor(cmBits[i]));
 		}
 	}
 	else {
-		for (i = 0; i <= (cmSize - 1); i += 1) {
+		for (i = 0; i < cmSize; i += 1) {
 			cm[i] = (cmBits[i]);
 		}
 	}
@@ -7272,12 +7272,12 @@
 	/* begin gradientRampOf: */
 	rampPtr = (objBuffer + fill1) + GFRampOffset;
 	if ((workBuffer[GWHasColorTransform]) != 0) {
-		for (i = 0; i <= (rampWidth - 1); i += 1) {
+		for (i = 0; i < rampWidth; i += 1) {
 			rampPtr[i] = (transformColor(ramp[i]));
 		}
 	}
 	else {
-		for (i = 0; i <= (rampWidth - 1); i += 1) {
+		for (i = 0; i < rampWidth; i += 1) {
 			rampPtr[i] = (ramp[i]);
 		}
 	}
@@ -7590,7 +7590,7 @@
 		x0 = (((int *) points))[0];
 		y0 = (((int *) points))[1];
 	}
-	for (i = 1; i <= (nPoints - 1); i += 1) {
+	for (i = 1; i < nPoints; i += 1) {
 		if (isShort) {
 			/* begin loadPointShortAt:from: */
 			x1 = (((short *) points))[i * 2];
@@ -8298,7 +8298,7 @@
     float *srcPtr;
 
 	srcPtr = ((float *) (firstIndexableField(transformOop)));
-	for (i = 0; i <= (n - 1); i += 1) {
+	for (i = 0; i < n; i += 1) {
 		destPtr[i] = (srcPtr[i]);
 	}
 }
@@ -9079,12 +9079,12 @@
 	/* begin colormapOf: */
 	cm = (objBuffer + fill1) + GBColormapOffset;
 	if ((workBuffer[GWHasColorTransform]) != 0) {
-		for (i = 0; i <= (cmSize - 1); i += 1) {
+		for (i = 0; i < cmSize; i += 1) {
 			cm[i] = (transformColor(cmBits[i]));
 		}
 	}
 	else {
-		for (i = 0; i <= (cmSize - 1); i += 1) {
+		for (i = 0; i < cmSize; i += 1) {
 			cm[i] = (cmBits[i]);
 		}
 	}
@@ -9594,7 +9594,7 @@
 		}
 		x0 = (point1Get())[0];
 		y0 = (point1Get())[1];
-		for (i = 1; i <= (nPoints - 1); i += 1) {
+		for (i = 1; i < nPoints; i += 1) {
 			loadPointfrom(point1Get(), fetchPointerofObject(i, points));
 			if (failed()) {
 				null;
@@ -9730,7 +9730,7 @@
 			x01 = (((int *) points1))[0];
 			y01 = (((int *) points1))[1];
 		}
-		for (i1 = 1; i1 <= (nPoints - 1); i1 += 1) {
+		for (i1 = 1; i1 < nPoints; i1 += 1) {
 			if (nPoints == length) {
 				/* begin loadPointShortAt:from: */
 				x11 = (((short *) points1))[i1 * 2];
@@ -10137,14 +10137,14 @@
 	}
 	src = workBuffer;
 	dst = firstIndexableField(buf2);
-	for (i = 0; i <= ((workBuffer[GWBufferTop]) - 1); i += 1) {
+	for (i = 0; i < (workBuffer[GWBufferTop]); i += 1) {
 		dst[i] = (src[i]);
 	}
 	dst[GWBufferTop] = ((workBuffer[GWBufferTop]) + diff);
 	dst[GWSize] = ((workBuffer[GWSize]) + diff);
 	src += workBuffer[GWBufferTop];
 	dst = (dst + (workBuffer[GWBufferTop])) + diff;
-	for (i = 0; i <= (((workBuffer[GWSize]) - (workBuffer[GWBufferTop])) - 1); i += 1) {
+	for (i = 0; i < ((workBuffer[GWSize]) - (workBuffer[GWBufferTop])); i += 1) {
 		dst[i] = (src[i]);
 	}
 	if (!(((failCode = loadWorkBufferFrom(buf2))) == 0)) {
@@ -10995,7 +10995,7 @@
 	}
 	ptr = firstIndexableField(pluginName);
 	needReload = 0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 
 		/* Compare and store the plugin to be used */
 
@@ -12092,7 +12092,7 @@
 	if (maxSteps < 2) {
 		maxSteps = 2;
 	}
-	scaledStepSize = 16777216 / maxSteps;
+	scaledStepSize = 0x1000000 / maxSteps;
 	/* begin absoluteSquared8Dot24: */
 	word1 = scaledStepSize & 0xFFFF;
 	word2 = (((usqInt) scaledStepSize >> 16)) & 0xFF;
@@ -12233,7 +12233,7 @@
 	objBuffer[line + GLErrorAdjUp] = errorAdjUp;
 	objBuffer[line + GLErrorAdjDown] = deltaY;
 	if (!(((startY = objBuffer[line + GEYValue])) == yValue)) {
-		for (i = startY; i <= (yValue - 1); i += 1) {
+		for (i = startY; i < yValue; i += 1) {
 			/* begin stepToNextLineIn:at: */
 			x = (objBuffer[line + GEXValue]) + (objBuffer[line + GLXIncrement]);
 			err = (objBuffer[line + GLError]) + (objBuffer[line + GLErrorAdjUp]);
@@ -12335,7 +12335,7 @@
 
 		/* Note: Must single step here so that entry/exit works */
 
-		for (i = startY; i <= (yValue - 1); i += 1) {
+		for (i = startY; i < yValue; i += 1) {
 			stepToNextWideBezierInat(bezier, i);
 		}
 		objBuffer[bezier + GENumLines] = ((objBuffer[bezier + GENumLines]) - (yValue - startY));
@@ -12420,7 +12420,7 @@
 		objBuffer[line + GEObjectType] = (((objBuffer[line + GEObjectType]) & GEPrimitiveTypeMask) | GEEdgeFillsInvalid);
 	}
 	if (!(startY == yValue)) {
-		for (i = startY; i <= (yValue - 1); i += 1) {
+		for (i = startY; i < yValue; i += 1) {
 			/* begin stepToNextWideLineIn:at: */
 			yEntry1 = (objBuffer[line + GLWideEntry]) + 1;
 			yExit1 = (objBuffer[line + GLWideExit]) + 1;

Modified: branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/BitBltPlugin/BitBltPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	BitBltSimulation VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	BitBltSimulation VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "BitBltSimulation VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -344,9 +344,9 @@
 };
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"BitBltPlugin VMMaker.oscog-eem.517 (i)"
+	"BitBltPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"BitBltPlugin VMMaker.oscog-eem.517 (e)"
+	"BitBltPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static sqInt noHalftone;
@@ -2112,7 +2112,7 @@
 
 					/* Woeful patch: revert to older code for hDir = -1 */
 
-					for (word = 2; word <= (nWords - 1); word += 1) {
+					for (word = 2; word < nWords; word += 1) {
 						thisWord = long32At(sourceIndex);
 						sourceIndex += hInc;
 						long32Atput(destIndex, thisWord);
@@ -2120,7 +2120,7 @@
 					}
 				}
 				else {
-					for (word = 2; word <= (nWords - 1); word += 1) {
+					for (word = 2; word < nWords; word += 1) {
 
 						/* Note loop starts with prevWord loaded (due to preload) */
 
@@ -2135,7 +2135,7 @@
 
 				/* Special inner loop for STORE mode -- no need to call merge */
 
-				for (word = 2; word <= (nWords - 1); word += 1) {
+				for (word = 2; word < nWords; word += 1) {
 					thisWord = long32At(sourceIndex);
 					sourceIndex += hInc;
 
@@ -2149,7 +2149,7 @@
 			}
 		}
 		else {
-			for (word = 2; word <= (nWords - 1); word += 1) {
+			for (word = 2; word < nWords; word += 1) {
 
 				/* Normal inner loop does merge: */
 
@@ -2231,7 +2231,7 @@
 			/* Special inner loop for STORE */
 
 			destWord = halftoneWord;
-			for (word = 2; word <= (nWords - 1); word += 1) {
+			for (word = 2; word < nWords; word += 1) {
 				long32Atput(destIndex, destWord);
 				destIndex += 4;
 			}
@@ -2240,7 +2240,7 @@
 
 			/* Normal inner loop does merge */
 
-			for (word = 2; word <= (nWords - 1); word += 1) {
+			for (word = 2; word < nWords; word += 1) {
 
 				/* Normal inner loop does merge */
 
@@ -4549,7 +4549,7 @@
 
 				/* Transfer mask */
 
-				mask3 = (1 << 32) - 1;
+				mask3 = (1LL << 32) - 1;
 				srcPix = v << d;
 				mask3 = mask3 << d;
 				destPix = srcPix & mask3;
@@ -6241,7 +6241,7 @@
 
 				/* Transfer mask */
 
-				mask3 = (1 << 32) - 1;
+				mask3 = (1LL << 32) - 1;
 				srcPix = v << d;
 				mask3 = mask3 << d;
 				destPix = srcPix & mask3;

Modified: branches/Cog/nscogsrc/plugins/DSAPrims/DSAPrims.c
===================================================================
--- branches/Cog/nscogsrc/plugins/DSAPrims/DSAPrims.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/DSAPrims/DSAPrims.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	DSAPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	DSAPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "DSAPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "DSAPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -94,9 +94,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"DSAPrims VMMaker.oscog-eem.517 (i)"
+	"DSAPrims VMMaker.oscog-eem.536 (i)"
 #else
-	"DSAPrims VMMaker.oscog-eem.517 (e)"
+	"DSAPrims VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static sqInt remainderDigitCount;
@@ -482,14 +482,14 @@
 	prodPtr = firstIndexableField(prod);
 	f2Ptr = firstIndexableField(f2);
 	f1Ptr = firstIndexableField(f1);
-	for (i = 0; i <= (f1Len - 1); i += 1) {
+	for (i = 0; i < f1Len; i += 1) {
 		if (((digit = f1Ptr[i])) != 0) {
 			carry = 0;
 
 			/* Loop invariants: 0 <= carry <= 16rFF, k = i + j - 1 */
 
 			k = i;
-			for (j = 0; j <= (f2Len - 1); j += 1) {
+			for (j = 0; j < f2Len; j += 1) {
 				sum = (((f2Ptr[j]) * digit) + (prodPtr[k])) + carry;
 				carry = ((usqInt) sum >> 8);
 				prodPtr[k] = (sum & 0xFF);

Modified: branches/Cog/nscogsrc/plugins/DropPlugin/DropPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/DropPlugin/DropPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/DropPlugin/DropPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	DropPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	DropPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "DropPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "DropPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -80,9 +80,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"DropPlugin VMMaker.oscog-eem.517 (i)"
+	"DropPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"DropPlugin VMMaker.oscog-eem.517 (e)"
+	"DropPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 
@@ -182,7 +182,7 @@
 	nameLength = strlen(dropName);
 	nameOop = instantiateClassindexableSize(classString(), nameLength);
 	namePtr = firstIndexableField(nameOop);
-	for (i = 0; i <= (nameLength - 1); i += 1) {
+	for (i = 0; i < nameLength; i += 1) {
 		namePtr[i] = (dropName[i]);
 	}
 	pop(2);

Modified: branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/FilePlugin/FilePlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	FilePlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	FilePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -180,9 +180,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FilePlugin VMMaker.oscog-eem.517 (i)"
+	"FilePlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"FilePlugin VMMaker.oscog-eem.517 (e)"
+	"FilePlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static void * sCCPfn;
@@ -200,6 +200,8 @@
 static sqInt
 asciiDirectoryDelimiter(void)
 {
+    sqInt fileSystem;
+
 	return dir_Delimitor();
 }
 
@@ -352,7 +354,7 @@
 
 	results = popRemappableOop();
 	stringPtr = firstIndexableField(nameString);
-	for (i = 0; i <= (entryNameSize - 1); i += 1) {
+	for (i = 0; i < entryNameSize; i += 1) {
 		stringPtr[i] = (entryName[i]);
 	}
 	storePointerofObjectwithValue(0, results, nameString);

Modified: branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/FloatArrayPlugin/FloatArrayPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	FloatArrayPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	FloatArrayPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "FloatArrayPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "FloatArrayPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -112,9 +112,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FloatArrayPlugin VMMaker.oscog-eem.517 (i)"
+	"FloatArrayPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"FloatArrayPlugin VMMaker.oscog-eem.517 (e)"
+	"FloatArrayPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 
@@ -186,7 +186,7 @@
 	}
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	argPtr = ((float *) (firstIndexableField(arg)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) + (((double) (argPtr[i]))));
 	}
 	pop(1);
@@ -215,7 +215,7 @@
 	}
 	length = stSizeOf(rcvr);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) + value);
 	}
 	pop(1);
@@ -315,12 +315,12 @@
 	/* Check if any of the argument's values is zero */
 
 	argPtr = ((float *) (firstIndexableField(arg)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		if ((intAtPointer(((char*) (argPtr + i)))) == 0) {
 			return primitiveFail();
 		}
 	}
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) / (((double) (argPtr[i]))));
 	}
 	pop(1);
@@ -354,7 +354,7 @@
 	length = stSizeOf(rcvr);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	inverse = 1.0 / value;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) * inverse);
 	}
 	pop(1);
@@ -395,7 +395,7 @@
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	argPtr = ((float *) (firstIndexableField(arg)));
 	result = 0.0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		result += (((double) (rcvrPtr[i]))) * (((double) (argPtr[i])));
 	}
 	pop(2);
@@ -429,7 +429,7 @@
 	}
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	argPtr = ((float *) (firstIndexableField(arg)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		if (!((rcvrPtr[i]) == (argPtr[i]))) {
 			return pushBool(0);
 		}
@@ -457,7 +457,7 @@
 	length = stSizeOf(rcvr);
 	rcvrPtr = ((int *) (firstIndexableField(rcvr)));
 	result = 0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		result += rcvrPtr[i];
 	}
 	pop(1);
@@ -490,7 +490,7 @@
 	success(1);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	result = 0.0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		result += (((double) (rcvrPtr[i]))) * (((double) (rcvrPtr[i])));
 	}
 	result = sqrt(result);
@@ -529,7 +529,7 @@
 	}
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	argPtr = ((float *) (firstIndexableField(arg)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) * (((double) (argPtr[i]))));
 	}
 	pop(1);
@@ -558,7 +558,7 @@
 	}
 	length = stSizeOf(rcvr);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) * value);
 	}
 	pop(1);
@@ -588,7 +588,7 @@
 	success(1);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	len = 0.0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		len += (((double) (rcvrPtr[i]))) * (((double) (rcvrPtr[i])));
 	}
 	success(len > 0.0);
@@ -596,7 +596,7 @@
 		return null;
 	}
 	len = sqrt(len);
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) / len);
 	}
 }
@@ -633,7 +633,7 @@
 	}
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	argPtr = ((float *) (firstIndexableField(arg)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) - (((double) (argPtr[i]))));
 	}
 	pop(1);
@@ -662,7 +662,7 @@
 	}
 	length = stSizeOf(rcvr);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		rcvrPtr[i] = ((((double) (rcvrPtr[i]))) - value);
 	}
 	pop(1);
@@ -693,7 +693,7 @@
 	length = stSizeOf(rcvr);
 	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
 	sum = 0.0;
-	for (i = 0; i <= (length - 1); i += 1) {
+	for (i = 0; i < length; i += 1) {
 		sum += ((double) (rcvrPtr[i]));
 	}
 	popthenPush(1, floatObjectOf(sum));

Modified: branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/JPEGReaderPlugin/JPEGReaderPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	JPEGReaderPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	JPEGReaderPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "JPEGReaderPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -180,9 +180,9 @@
 static sqInt jsReadLimit;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"JPEGReaderPlugin VMMaker.oscog-eem.517 (i)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"JPEGReaderPlugin VMMaker.oscog-eem.517 (e)"
+	"JPEGReaderPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static int *residuals;
@@ -226,7 +226,7 @@
 	if (max > MaxMCUBlocks) {
 		return 0;
 	}
-	for (i = 0; i <= (max - 1); i += 1) {
+	for (i = 0; i < max; i += 1) {
 		blockOop = fetchPointerofObject(i, arrayOop);
 		if (isIntegerObject(blockOop)) {
 			return 0;
@@ -280,7 +280,7 @@
 
 	yComponent[CurrentXIndex] = 0;
 	yComponent[CurrentYIndex] = 0;
-	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
+	for (i = 0; i < jpegBitsSize; i += 1) {
 		/* begin nextSampleY */
 		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
@@ -353,7 +353,7 @@
 	cbComponent[CurrentYIndex] = 0;
 	crComponent[CurrentXIndex] = 0;
 	crComponent[CurrentYIndex] = 0;
-	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
+	for (i = 0; i < jpegBitsSize; i += 1) {
 		/* begin nextSampleY */
 		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
@@ -519,7 +519,7 @@
 	}
 	byte = aColorComponent[PriorDCValueIndex] = ((aColorComponent[PriorDCValueIndex]) + byte);
 	anArray[0] = byte;
-	for (i = 1; i <= (DCTSize2 - 1); i += 1) {
+	for (i = 1; i < DCTSize2; i += 1) {
 		anArray[i] = 0;
 	}
 	index = 1;
@@ -720,9 +720,9 @@
     sqInt z5;
 
 	
-	for (i = 0; i <= (DCTSize - 1); i += 1) {
+	for (i = 0; i < DCTSize; i += 1) {
 		anACTerm = -1;
-		for (row = 1; row <= (DCTSize - 1); row += 1) {
+		for (row = 1; row < DCTSize; row += 1) {
 			if (anACTerm == -1) {
 				if (!((anArray[(row * DCTSize) + i]) == 0)) {
 					anACTerm = row;
@@ -731,7 +731,7 @@
 		}
 		if (anACTerm == -1) {
 			dcval = ((anArray[i]) * (qt[0])) << Pass1Bits;
-			for (j = 0; j <= (DCTSize - 1); j += 1) {
+			for (j = 0; j < DCTSize; j += 1) {
 				ws[(j * DCTSize) + i] = dcval;
 			}
 		}
@@ -1186,7 +1186,7 @@
 	/* begin colorConvertGrayscaleMCU */
 	yComponent[CurrentXIndex] = 0;
 	yComponent[CurrentYIndex] = 0;
-	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
+	for (i = 0; i < jpegBitsSize; i += 1) {
 		/* begin nextSampleY */
 		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
@@ -1310,7 +1310,7 @@
 	cbComponent[CurrentYIndex] = 0;
 	crComponent[CurrentXIndex] = 0;
 	crComponent[CurrentYIndex] = 0;
-	for (i = 0; i <= (jpegBitsSize - 1); i += 1) {
+	for (i = 0; i < jpegBitsSize; i += 1) {
 		/* begin nextSampleY */
 		dx = (curX = yComponent[CurrentXIndex]);
 		dy = yComponent[CurrentYIndex];
@@ -1535,7 +1535,7 @@
 	}
 	byte = yComponent[PriorDCValueIndex] = ((yComponent[PriorDCValueIndex]) + byte);
 	anArray[0] = byte;
-	for (i = 1; i <= (DCTSize2 - 1); i += 1) {
+	for (i = 1; i < DCTSize2; i += 1) {
 		anArray[i] = 0;
 	}
 	index = 1;
@@ -1684,9 +1684,9 @@
 	anArray = firstIndexableField(arrayOop);
 	/* begin idctBlockInt:qt: */
 	;
-	for (i = 0; i <= (DCTSize - 1); i += 1) {
+	for (i = 0; i < DCTSize; i += 1) {
 		anACTerm = -1;
-		for (row = 1; row <= (DCTSize - 1); row += 1) {
+		for (row = 1; row < DCTSize; row += 1) {
 			if (anACTerm == -1) {
 				if (!((anArray[(row * DCTSize) + i]) == 0)) {
 					anACTerm = row;
@@ -1695,7 +1695,7 @@
 		}
 		if (anACTerm == -1) {
 			dcval = ((anArray[i]) * (qt[0])) << Pass1Bits;
-			for (j = 0; j <= (DCTSize - 1); j += 1) {
+			for (j = 0; j < DCTSize; j += 1) {
 				ws[(j * DCTSize) + i] = dcval;
 			}
 		}

Modified: branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c
===================================================================
--- branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/LargeIntegers/LargeIntegers.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	LargeIntegersPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	LargeIntegersPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -172,9 +172,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"LargeIntegers v1.5 VMMaker.oscog-eem.517 (i)"
+	"LargeIntegers v1.5 VMMaker.oscog-eem.536 (i)"
 #else
-	"LargeIntegers v1.5 VMMaker.oscog-eem.517 (e)"
+	"LargeIntegers v1.5 VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static const int  orOpIndex = 1;
@@ -229,7 +229,7 @@
 	if ((((usqInt) (digitOfBytesat(magnitude, firstByteIx))) >> rightShift) != 0) {
 		return 1;
 	}
-	for (ix = (firstByteIx + 1); ix <= (lastByteIx - 1); ix += 1) {
+	for (ix = (firstByteIx + 1); ix < lastByteIx; ix += 1) {
 		if ((digitOfBytesat(magnitude, ix)) != 0) {
 			return 1;
 		}
@@ -474,7 +474,7 @@
 	/* begin sqAssert: */
 	/* missing DebugCode */;
 l4:	/* end sqAssert: */;
-	for (j = (b + 1); j <= (i - 1); j += 1) {
+	for (j = (b + 1); j < i; j += 1) {
 		digit1 = pFrom[j];
 		x1 = (((usqInt) x1) >> 8) | (digit1 << f);
 		pTo[(j - b) - 1] = (x1 & 0xFF);
@@ -667,7 +667,7 @@
 	/* begin sqAssert: */
 	/* missing DebugCode */;
 l2:	/* end sqAssert: */;
-	for (j = (b + 1); j <= (count - 1); j += 1) {
+	for (j = (b + 1); j < count; j += 1) {
 		digit = pFrom[j];
 		x = (((usqInt) x) >> 8) | (digit << f);
 		pTo[(j - b) - 1] = (x & 0xFF);
@@ -873,7 +873,7 @@
 	 && (csi > -65536)) {
 		return 2;
 	}
-	if ((csi < 16777216)
+	if ((csi < 0x1000000)
 	 && (csi > -16777216)) {
 		return 3;
 	}
@@ -1096,7 +1096,7 @@
 		size = 2;
 		goto l1;
 	}
-	if ((val < 16777216)
+	if ((val < 0x1000000)
 	 && (val > -16777216)) {
 		size = 3;
 		goto l1;
@@ -1414,7 +1414,7 @@
 			divLen = 2;
 			goto l1;
 		}
-		if (((integerValueOf(div)) < 16777216)
+		if (((integerValueOf(div)) < 0x1000000)
 		 && ((integerValueOf(div)) > -16777216)) {
 			divLen = 3;
 			goto l1;
@@ -1441,7 +1441,7 @@
 			remLen = 2;
 			goto l2;
 		}
-		if (((integerValueOf(rem)) < 16777216)
+		if (((integerValueOf(rem)) < 0x1000000)
 		 && ((integerValueOf(rem)) > -16777216)) {
 			remLen = 3;
 			goto l2;
@@ -1468,7 +1468,7 @@
 			quoLen = 2;
 			goto l3;
 		}
-		if (((integerValueOf(quo)) < 16777216)
+		if (((integerValueOf(quo)) < 0x1000000)
 		 && ((integerValueOf(quo)) > -16777216)) {
 			quoLen = 3;
 			goto l3;
@@ -1611,7 +1611,7 @@
 		 && ((integerValueOf(oop)) > -65536)) {
 			return 2;
 		}
-		if (((integerValueOf(oop)) < 16777216)
+		if (((integerValueOf(oop)) < 0x1000000)
 		 && ((integerValueOf(oop)) > -16777216)) {
 			return 3;
 		}
@@ -2004,7 +2004,7 @@
 			len = 2;
 			goto l1;
 		}
-		if (((integerValueOf(anInteger)) < 16777216)
+		if (((integerValueOf(anInteger)) < 0x1000000)
 		 && ((integerValueOf(anInteger)) > -16777216)) {
 			len = 3;
 			goto l1;
@@ -3142,7 +3142,7 @@
 	strLen = strlen(getModuleName());
 	strOop = instantiateClassindexableSize(classString(), strLen);
 	strPtr = firstIndexableField(strOop);
-	for (i = 0; i <= (strLen - 1); i += 1) {
+	for (i = 0; i < strLen; i += 1) {
 		strPtr[i] = ((getModuleName())[i]);
 	}
 	if (failed()) {

Modified: branches/Cog/nscogsrc/plugins/SecurityPlugin/SecurityPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/SecurityPlugin/SecurityPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/SecurityPlugin/SecurityPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	SecurityPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	SecurityPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "SecurityPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "SecurityPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -96,9 +96,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"SecurityPlugin VMMaker.oscog-eem.517 (i)"
+	"SecurityPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"SecurityPlugin VMMaker.oscog-eem.517 (e)"
+	"SecurityPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 
@@ -180,7 +180,7 @@
 		return null;
 	}
 	dirPtr = firstIndexableField(dirOop);
-	for (i = 0; i <= (dirLen - 1); i += 1) {
+	for (i = 0; i < dirLen; i += 1) {
 		dirPtr[i] = (dirName[i]);
 	}
 	popthenPush(1, dirOop);
@@ -209,7 +209,7 @@
 		return null;
 	}
 	dirPtr = firstIndexableField(dirOop);
-	for (i = 0; i <= (dirLen - 1); i += 1) {
+	for (i = 0; i < dirLen; i += 1) {
 		dirPtr[i] = (dirName[i]);
 	}
 	popthenPush(1, dirOop);

Modified: branches/Cog/nscogsrc/plugins/SqueakSSL/SqueakSSL.c
===================================================================
--- branches/Cog/nscogsrc/plugins/SqueakSSL/SqueakSSL.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/SqueakSSL/SqueakSSL.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
 	SqueakSSLPlugin SqueakSSL-Plugin-ar.3 uuid: b76dbadd-ee96-5e44-abbb-8a0e3e17240a
  */
@@ -454,7 +454,7 @@
 		stringLen = strlen(stringPtr);
 		stringOop = instantiateClassindexableSize(classString(), stringLen);
 		oopPtr = firstIndexableField(stringOop);
-		for (i = 0; i <= (stringLen - 1); i += 1) {
+		for (i = 0; i < stringLen; i += 1) {
 			oopPtr[i] = (stringPtr[i]);
 		}
 	}

Modified: branches/Cog/nscogsrc/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/VMProfileMacSupportPlugin/VMProfileMacSupportPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	VMProfileMacSupportPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMProfileMacSupportPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "VMProfileMacSupportPlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "VMProfileMacSupportPlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -102,9 +102,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"VMProfileMacSupportPlugin VMMaker.oscog-eem.517 (i)"
+	"VMProfileMacSupportPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"VMProfileMacSupportPlugin VMMaker.oscog-eem.517 (e)"
+	"VMProfileMacSupportPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 
@@ -164,7 +164,7 @@
 	sz = byteSizeOf(nameObj);
 	name = malloc(sz + 1);
 	namePtr = firstIndexableField(nameObj);
-	for (i = 0; i <= (sz - 1); i += 1) {
+	for (i = 0; i < sz; i += 1) {
 		name[i] = (namePtr[i]);
 	}
 	name[sz] = 0;
@@ -206,7 +206,7 @@
 		return primitiveFail();
 	}
 	pushRemappableOop(resultObj);
-	for (i = 0; i <= (nimages - 1); i += 1) {
+	for (i = 0; i < nimages; i += 1) {
 
 		/* impossible start & size */
 

Modified: branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/plugins/ZipPlugin/ZipPlugin.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	DeflatePlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	DeflatePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "DeflatePlugin VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "DeflatePlugin VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 
 
 
@@ -136,9 +136,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"ZipPlugin VMMaker.oscog-eem.517 (i)"
+	"ZipPlugin VMMaker.oscog-eem.536 (i)"
 #else
-	"ZipPlugin VMMaker.oscog-eem.517 (e)"
+	"ZipPlugin VMMaker.oscog-eem.536 (e)"
 #endif
 ;
 static unsigned int zipBaseDistance[] = {
@@ -358,7 +358,7 @@
 			flushNeeded = (zipLiteralCount == zipLiteralSize)
 			 || (((zipLiteralCount & 0xFFF) == 0)
 			 && (shouldFlush()));
-			for (i = 1; i <= (hereLength - 1); i += 1) {
+			for (i = 1; i < hereLength; i += 1) {
 				/* begin insertStringAt: */
 				here1 = (here += 1);
 				zipHashValue = ((zipHashValue << DeflateHashShift) ^ (zipCollection[(here1 + DeflateMinMatch) - 1])) & DeflateHashMask;
@@ -823,7 +823,7 @@
 	}
 	tableSize = slotSizeOf(table);
 	tablePtr = firstIndexableField(table);
-	for (i = 0; i <= (tableSize - 1); i += 1) {
+	for (i = 0; i < tableSize; i += 1) {
 		entry = tablePtr[i];
 		if (entry >= delta) {
 			tablePtr[i] = (entry - delta);

Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c	2013-11-23 00:51:45 UTC (rev 2817)
+++ branches/Cog/nscogsrc/vm/cogit.c	2013-12-05 20:14:48 UTC (rev 2818)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	CCodeGenerator VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	StackToRegisterMappingCogit VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.536 uuid: c021f329-3f3a-469b-a838-24e74c1be39c " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -427,7 +427,7 @@
 static CogMethod * cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase);
 CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop);
 void compactCogCompiledCode(void);
-static void compactCompiledCode(sqInt objectHeaderValue);
+static void compactCompiledCode(void);
 static void compileAbort(void);
 static sqInt compileAbstractInstructionsFromthrough(sqInt start, sqInt end);
 static sqInt compileBlockBodies(void);
@@ -569,7 +569,6 @@
 static void freeMethod(CogMethod *cogMethod);
 static void freeOlderMethodsForCompaction(void);
 static void freePICsWithFreedTargets(void);
-static usqInt freeStart(void);
 static sqInt genActiveContextTrampoline(void);
 static sqInt genAddSmallIntegerTagsTo(sqInt aRegister);
 static sqInt genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment);
@@ -585,6 +584,7 @@
 static void (*genEnilopmartForandandcalled(sqInt regArg1, sqInt regArg2, sqInt regArg3, char *trampolineName))(void) ;
 static void (*genEnilopmartForandcalled(sqInt regArg1, sqInt regArg2, char *trampolineName))(void) ;
 static void (*genEnilopmartForcalled(sqInt regArg, char *trampolineName))(void) ;
+static sqInt genEnsureRegNotForwardedscratchReg(sqInt reg, sqInt scratch);
 static void (*genEnterPICEnilopmartNumArgs(sqInt numArgs))(void) ;
 static sqInt genExtendedSendBytecode(void);
 static sqInt genExtendedSuperBytecode(void);
@@ -839,6 +839,7 @@
 static sqInt inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt callSiteReturnAddress);
 static sqInt inlineCacheTagForInstance(sqInt oop);
 static sqInt inlineCacheTagIsYoung(sqInt cacheTag);
+static sqInt inlineCacheTagsMayBeObjects(void);
 static sqInt instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc);
 sqInt interpretOffset(void);
 static sqInt inverseBranchFor(sqInt opcode);
@@ -963,6 +964,7 @@
 void printCogMethods(void);
 void printCogMethodsOfType(sqInt cmType);
 void printCogMethodsWithMethod(sqInt methodOop);
+void printCogMethodsWithPrimitive(sqInt primIdx);
 void printCogMethodsWithSelector(sqInt selectorOop);
 void printTrampolineTable(void);
 static sqInt processorHasDivQuoRem(sqInt ignoredPrimIndex);
@@ -2014,6 +2016,7 @@
 #define entryOffset() cmEntryOffset
 #define fixupAt(index) (&fixups[index])
 #define flushICacheFromto(me,startAddress,endAddress) 0
+#define freeStart() mzFreeStart
 #define generatorAt(index) (&generatorTable[index])
 #define getCFramePointer() CFramePointer
 #define getCStackPointer() CStackPointer
@@ -2659,6 +2662,9 @@
     sqInt selector;
 
 	
+	if (isOopForwarded(receiver)) {
+		return ceSendFromInLineCacheMiss(cPIC);
+	}
 	outerReturn = stackTop();
 	if (((cPIC->cPICNumCases)) < numPICCases) {
 		/* begin lookup:for:methodAndErrorSelectorInto: */
@@ -2815,6 +2821,9 @@
 
 	innerReturn = popStack();
 	targetMethod = ((CogMethod *) (innerReturn - missOffset));
+	if (isOopForwarded(receiver)) {
+		return ceSendFromInLineCacheMiss(targetMethod);
+	}
 	outerReturn = stackTop();
 	assert(((outerReturn >= methodZoneBase) && (outerReturn <= (freeStart()))));
 	entryPoint = callTargetFromReturnAddress(backEnd, outerReturn);
@@ -2902,7 +2911,9 @@
 		}
 		flushICacheFromto(processor, ((sqInt)pic), (((sqInt)pic)) + closedPICSize);
 	}
-	extent = rewriteCallAttarget(backEnd, outerReturn, (((sqInt)pic)) + cmEntryOffset);
+	extent = (((pic->cmType)) == CMOpenPIC
+		? rewriteInlineCacheAttagtarget(backEnd, outerReturn, (targetMethod->selector), (((sqInt)pic)) + cmEntryOffset)
+		: rewriteCallAttarget(backEnd, outerReturn, (((sqInt)pic)) + cmEntryOffset));
 	flushICacheFromto(processor, (outerReturn - 1) - extent, outerReturn - 1);
 	executeCogMethodFromLinkedSendwithReceiverandCacheTag(pic, receiver, inlineCacheTagAt(backEnd, outerReturn));
 	return null;
@@ -3040,8 +3051,7 @@
 		selectorOrCacheTag = inlineCacheTagAt(backEnd, ((sqInt)mcpc));
 		if ((entryPoint > methodZoneBase)
 		 && ((offset != cmNoCheckEntryOffset)
-		 && (((((((CogMethod *) (entryPoint + offset)))->cmType)) != CMOpenPIC)
-		 || (!(couldBeObject(selectorOrCacheTag)))))) {
+		 && ((((((CogMethod *) (entryPoint - offset)))->cmType)) != CMOpenPIC))) {
 
 			/* linked non-super send, cacheTag is a cacheTag */
 
@@ -3159,6 +3169,9 @@
     sqInt maybeObject;
 
 	maybeObject = literalBeforeFollowingAddress(backEnd, mcpc);
+	if (maybeObject == 0) {
+		return 1;
+	}
 	if (!(couldBeObject(maybeObject))) {
 		return 1;
 	}
@@ -3211,13 +3224,15 @@
 	}
 	pc += cPICCaseSize;
 	for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) {
-		if (!(checkMaybeObjRefAt((pc - (jumpLongConditionalByteSize(backEnd))) - (loadLiteralByteSize(backEnd))))) {
-			print("object leak in CPIC ");
-			printHex(((sqInt)cPIC));
-			print(" @ ");
-			printHex((pc - (jumpLongConditionalByteSize(backEnd))) - (loadLiteralByteSize(backEnd)));
-			cr();
-			ok = 0;
+		if (inlineCacheTagsMayBeObjects()) {
+			if (!(checkMaybeObjRefAt((pc - (jumpLongConditionalByteSize(backEnd))) - (loadLiteralByteSize(backEnd))))) {
+				print("object leak in CPIC ");
+				printHex(((sqInt)cPIC));
+				print(" @ ");
+				printHex((pc - (jumpLongConditionalByteSize(backEnd))) - (loadLiteralByteSize(backEnd)));
+				cr();
+				ok = 0;
+			}
 		}
 		if (!(checkMaybeObjRefAt(pc - (jumpLongConditionalByteSize(backEnd))))) {
 			print("object leak in CPIC ");
@@ -3391,7 +3406,7 @@
 	}
 	storePointerUncheckedofObjectwithValue(0, topRemappableOop(), label);
 	storePointerUncheckedofObjectwithValue(1, topRemappableOop(), value);
-	for (i = 0; i <= (trampolineTableIndex - 1); i += 2) {
+	for (i = 0; i < trampolineTableIndex; i += 2) {
 		if ((((label = stringForCString(trampolineAddresses[i]))) == null)
 		 || (((value = cePositive32BitIntegerFor(((usqInt)(trampolineAddresses[i + 1]))))) == null)) {
 			popRemappableOop();
@@ -3417,7 +3432,7 @@
 		cogMethod = methodAfter(cogMethod);
 	}
 	if ((((label = stringForCString("CCFree"))) == null)
-	 || (((value = cePositive32BitIntegerFor(mzFreeStart))) == null)) {
+	 || (((value = cePositive32BitIntegerFor(freeStart()))) == null)) {
 		popRemappableOop();
 		return null;
 	}
@@ -3543,7 +3558,7 @@
 		if (((cogMethod->objectHeader)) >= 0) {
 			if ((((cogMethod->methodObject)) != 0)
 			 && ((((cogMethod->methodObject)) < methodZoneBase)
-			 || ((((cogMethod->methodObject)) > (mzFreeStart - openPICSize))
+			 || ((((cogMethod->methodObject)) > ((freeStart()) - openPICSize))
 			 || (((((cogMethod->methodObject)) & (BytesPerWord - 1)) != 0)
 			 || ((((((CogMethod *) ((cogMethod->methodObject))))->cmType)) != CMOpenPIC))))) {
 				return 23;
@@ -3748,19 +3763,21 @@
 	planCompaction();
 	updateStackZoneReferencesToCompiledCodePreCompaction();
 	relocateMethodsPreCompaction();
-	compactCompiledCode(nullHeaderForMachineCodeMethod());
+	compactCompiledCode();
 	assert(allMethodsHaveCorrectHeader());
 	assert(kosherYoungReferrers());
-	flushICacheFromto(processor, methodZoneBase, mzFreeStart);
+	flushICacheFromto(processor, methodZoneBase, freeStart());
 }
 
 static void
-compactCompiledCode(sqInt objectHeaderValue)
+compactCompiledCode(void)
 {
     unsigned short bytes;
     CogMethod *dest;
+    sqInt objectHeaderValue;
     CogMethod *source;
 
+	objectHeaderValue = nullHeaderForMachineCodeMethod();
 	source = ((CogMethod *) baseAddress);
 	openPICList = null;
 	methodCount = 0;
@@ -4184,7 +4201,7 @@
 	genLoadSlotsourceRegdestReg(ReceiverIndex, TempReg, ClassReg);
 	/* begin PushR: */
 	genoperand(PushR, ClassReg);
-	for (i = 0; i <= (((blockStart->numCopied)) - 1); i += 1) {
+	for (i = 0; i < ((blockStart->numCopied)); i += 1) {
 		genLoadSlotsourceRegdestReg(i + ClosureFirstCopiedValueIndex, ReceiverResultReg, TempReg);
 		/* begin PushR: */
 		genoperand(PushR, TempReg);
@@ -4263,7 +4280,7 @@
 	/* begin JumpLong: */
 	genoperand(JumpLong, 1592642142);
 	jmpTarget(jumpNext, (endCPICCase0 = gLabel()));
-	for (h = 1; h <= (numPICCases - 1); h += 1) {
+	for (h = 1; h < numPICCases; h += 1) {
 		/* begin CmpCw:R: */
 		genoperandoperand(CmpCwR, 3133021973UL + h, TempReg);
 		/* begin MoveCw:R: */
@@ -4830,8 +4847,9 @@
 
 
 /*	Compile the code for an open PIC. Perform a probe of the first-level
-	method lookup cache followed by a call of ceSendFromOpenPIC: if the probe
-	fails. Override to push the register args when calling ceSendFromOpenPIC: */
+	method lookup cache followed by a call of ceSendFromInLineCacheMiss: if
+	the probe fails.
+	Override to push the register args when calling ceSendFromInLineCacheMiss: */
 
 static void
 compileOpenPICnumArgs(sqInt selector, sqInt numArgs)
@@ -5396,7 +5414,7 @@
     sqInt relativeAddress;
 
 	relativeAddress = 0;
-	for (i = 0; i <= (opcodeIndex - 1); i += 1) {
+	for (i = 0; i < opcodeIndex; i += 1) {
 		abstractInstruction = abstractInstructionAt(i);
 		(abstractInstruction->address = relativeAddress);
 		computeMaximumSize(abstractInstruction);
@@ -5603,7 +5621,7 @@
     sqInt i;
 
 	flag("if performance is an issue generate longer nops");
-	for (i = 0; i <= (((self_in_concretizeAlignmentNops->machineCodeSize)) - 1); i += 1) {
+	for (i = 0; i < ((self_in_concretizeAlignmentNops->machineCodeSize)); i += 1) {
 		((self_in_concretizeAlignmentNops->machineCode))[i] = 144;
 	}
 	return self_in_concretizeAlignmentNops;
@@ -7663,7 +7681,7 @@
 	case AlignmentNops:
 		/* begin concretizeAlignmentNops */
 		flag("if performance is an issue generate longer nops");
-		for (i = 0; i <= (((self_in_dispatchConcretize->machineCodeSize)) - 1); i += 1) {
+		for (i = 0; i < ((self_in_dispatchConcretize->machineCodeSize)); i += 1) {
 			((self_in_dispatchConcretize->machineCode))[i] = 144;
 		}
 		return;
@@ -9921,7 +9939,7 @@
 	else {
 		assert(blockNoContextSwitchOffset == (((blockEntryLabel->address)) - ((blockEntryNoContextSwitch->address))));
 	}
-	for (i = 0; i <= (blockCount - 1); i += 1) {
+	for (i = 0; i < blockCount; i += 1) {
 		blockStart = blockStartAt(i);
 		blockHeader = ((CogBlockMethod *) ((((blockStart->fakeHeader))->address)));
 		(blockHeader->homeOffset = ((((blockStart->fakeHeader))->address)) - startAddress);
@@ -10244,13 +10262,7 @@
 	assert(count == (numMethods()));
 }
 
-static usqInt
-freeStart(void)
-{
-	return mzFreeStart;
-}
 
-
 /*	Short-circuit the interpreter call if a frame is already married. */
 
 static sqInt
@@ -10753,6 +10765,16 @@
 }
 
 
+/*	Make sure that the obejct in reg is not forwarded. By default there is
+	nothing to do. Subclasses for memory managers that forward will override. */
+
+static sqInt
+genEnsureRegNotForwardedscratchReg(sqInt reg, sqInt scratch)
+{
+	return 0;
+}
+
+
 /*	Generate special versions of the ceEnterCogCodePopReceiverAndClassRegs
 	enilopmart that also pop register args from the stack to undo the pushing
 	of register args in the abort/miss trampolines. */
@@ -11348,7 +11370,7 @@
 	headerSize = sizeof(CogMethod);
 	(methodLabel->address = -headerSize);
 	computeMaximumSizes();
-	concretizeAt(methodLabel, mzFreeStart);
+	concretizeAt(methodLabel, freeStart());
 	codeSize = generateInstructionsAt(((methodLabel->address)) + headerSize);
 	mapSize = generateMapAtstart(0, ((methodLabel->address)) + cmNoCheckEntryOffset);
 	totalSize = roundUpLength((headerSize + codeSize) + mapSize);
@@ -11461,7 +11483,7 @@
 
 	absoluteAddress = eventualAbsoluteAddress;
 	pcDependentIndex = 0;
-	for (i = 0; i <= (opcodeIndex - 1); i += 1) {
+	for (i = 0; i < opcodeIndex; i += 1) {
 		if (breakPC == absoluteAddress) {
 			haltmsg("breakPC reached in generateInstructionsAt:");
 		}
@@ -11477,7 +11499,7 @@
 			absoluteAddress = concretizeAt(abstractInstruction, absoluteAddress);
 		}
 	}
-	for (i = 0; i <= (pcDependentIndex - 1); i += 1) {
+	for (i = 0; i < pcDependentIndex; i += 1) {
 		fixup = fixupAt(i);
 		abstractInstruction = abstractInstructionAt((fixup->instructionIndex));
 		if (breakPC == absoluteAddress) {
@@ -11554,7 +11576,7 @@
 
 	length = 0;
 	location = startAddress;
-	for (i = 0; i <= (annotationIndex - 1); i += 1) {
+	for (i = 0; i < annotationIndex; i += 1) {
 		annotation = (&(annotations[i]));
 		mcpc = ((((annotation->instruction))->address)) + ((((annotation->instruction))->machineCodeSize));
 		while (((delta = mcpc - location)) > MaxUnitDisplacement) {
@@ -14187,6 +14209,7 @@
 
 	association = getLiteral(literalIndex);
 	annotateobjRef(gMoveCwR(association, TempReg), association);
+	genEnsureRegNotForwardedscratchReg(TempReg, freeReg);
 	genLoadSlotsourceRegdestReg(ValueIndex, TempReg, freeReg);
 	ssPushRegister(freeReg);
 	return 0;
@@ -15419,6 +15442,7 @@
 	 && (!(shouldAnnotateObjectReference(constVal)))) {
 		ssAllocateRequiredReg(ReceiverResultReg);
 		annotateobjRef(gMoveCwR(association, ReceiverResultReg), association);

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list