[Vm-dev] [commit][2832] CogVM source as per VMMaker.oscog-eem.561

commits at squeakvm.org commits at squeakvm.org
Thu Dec 12 22:53:15 UTC 2013


Revision: 2832
Author:   eliot
Date:     2013-12-12 14:53:13 -0800 (Thu, 12 Dec 2013)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.561

Simplify StackInterpreter>>arrayValueOf: (isWordsOrBytes:
already filters-out immediates).

Remove RPATH spec from unix builds.

Spur:
Fix swizzling of Spur objStacks on start-up.  Spur now snapshots and resumes.
Beef up the objStack asserts and printing to identify my prior malfeasance.

Modified Paths:
--------------
    branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.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/platforms/unix/config/make.prg.in
    branches/Cog/scripts/findUnofficialFiles
    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/UnixOSProcessPlugin/UnixOSProcessPlugin.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

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

Modified: branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c
===================================================================
--- branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/plugins/UnixOSProcessPlugin/UnixOSProcessPlugin.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.517 uuid: 14ff7126-70ec-4cc4-9f55-70256e6a3d35
+	VMPluginCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.44 uuid: 946fd79a-b249-4f25-8d13-11c6a087296f
+	UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 uuid: 7e7b595f-3783-417f-b514-4f5323e0a3c1
  */
-static char __buildInfo[] = "UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.44 uuid: 946fd79a-b249-4f25-8d13-11c6a087296f " __DATE__ ;
+static char __buildInfo[] = "UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 uuid: 7e7b595f-3783-417f-b514-4f5323e0a3c1 " __DATE__ ;
 /* D T Lewis - UnixOSProcessPlugin.c translated from class
    UnixOSProcessPlugin of OSProcessPlugin version 4.3.3 Cog */
 
@@ -318,9 +318,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.44 (i)"
+	"UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 (i)"
 #else
-	"UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.44 (e)"
+	"UnixOSProcessPlugin VMConstruction-Plugins-OSProcessPlugin.oscog-eem.45 (e)"
 #endif
 ;
 static void *originalSigHandlers[NSIG];

Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/cogit.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator * VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+	CCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	StackToRegisterMappingCogit * VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+	StackToRegisterMappingCogit VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit * VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 

Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/cogit.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator * VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+	CCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 

Modified: branches/Cog/nscogsrc/vm/cogmethod.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogmethod.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/cogmethod.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.554 uuid: a666e7e4-245e-4e8a-9536-3aefd4509f47
+	CCodeGenerator VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 typedef struct {

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	CoInterpreter VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __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 usqInt safeObjectAfter(sqInt oop);
+static sqInt safeObjectAfter(sqInt oop);
 static sqInt safePrintStringOf(sqInt oop);
 usqInt scavengeThresholdAddress(void);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -2030,7 +2030,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.558";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.561";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5666,7 +5666,6 @@
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
 					}
-					null;
 					goto l4;
 				}
 				if (opType == 3) {
@@ -5676,7 +5675,6 @@
 					assert(GIV(method) == (iframeMethod(localFP)));
 					object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object);
-					null;
 					goto l4;
 				}
 				if (opType == 4) {
@@ -5690,7 +5688,6 @@
 					object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object2);
 
-					null;
 					goto l4;
 				}
 				top = longAtPointer(localSP);
@@ -13716,8 +13713,7 @@
 arrayValueOf(sqInt arrayOop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
 	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 1) == 0)
-	 && (isWordsOrBytesNonImm(arrayOop)))) {
+	 && (isWordsOrBytesNonImm(arrayOop))) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -20877,8 +20873,7 @@
 	arrayOop = longAt((objectPointer + BaseHeaderSize) + (fieldIndex << ShiftForWord));
 	/* begin arrayValueOf: */
 	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 1) == 0)
-	 && (isWordsOrBytesNonImm(arrayOop)))) {
+	 && (isWordsOrBytesNonImm(arrayOop))) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -23729,15 +23724,17 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
+    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    usqInt next;
+    sqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
+    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -23748,7 +23745,21 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			next = ((sqInt) (objectAfter(oop)));
+			/* 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]);
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23763,7 +23774,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
+		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -23817,18 +23828,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header3 = longAt(newFreeChunk);
-		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
+		header4 = longAt(newFreeChunk);
+		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header3 & SizeMask);
+			: header4 & SizeMask);
 	}
-	next = ((newFreeChunk + sz2) >= GIV(freeStart)
+	next = ((newFreeChunk + sz3) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
+		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -50038,7 +50049,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static usqInt
+static sqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	CoInterpreter VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __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 usqInt safeObjectAfter(sqInt oop);
+static sqInt safeObjectAfter(sqInt oop);
 static sqInt safePrintStringOf(sqInt oop);
 usqInt scavengeThresholdAddress(void);
 EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
@@ -2033,7 +2033,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.558";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.561";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5675,7 +5675,6 @@
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), longAt((rcvr + BaseHeaderSize) + (byte3 << ShiftForWord)));
 					}
-					null;
 					goto l4;
 				}
 				if (opType == 3) {
@@ -5685,7 +5684,6 @@
 					assert(GIV(method) == (iframeMethod(localFP)));
 					object = longAt((GIV(method) + BaseHeaderSize) + ((byte3 + LiteralStart) << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object);
-					null;
 					goto l4;
 				}
 				if (opType == 4) {
@@ -5699,7 +5697,6 @@
 					object2 = longAt((oop + BaseHeaderSize) + (ValueIndex << ShiftForWord));
 					longAtPointerput((localSP -= BytesPerOop), object2);
 
-					null;
 					goto l4;
 				}
 				top = longAtPointer(localSP);
@@ -13725,8 +13722,7 @@
 arrayValueOf(sqInt arrayOop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
 	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 1) == 0)
-	 && (isWordsOrBytesNonImm(arrayOop)))) {
+	 && (isWordsOrBytesNonImm(arrayOop))) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -20886,8 +20882,7 @@
 	arrayOop = longAt((objectPointer + BaseHeaderSize) + (fieldIndex << ShiftForWord));
 	/* begin arrayValueOf: */
 	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 1) == 0)
-	 && (isWordsOrBytesNonImm(arrayOop)))) {
+	 && (isWordsOrBytesNonImm(arrayOop))) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -23738,15 +23733,17 @@
     sqInt header1;
     sqInt header2;
     sqInt header3;
+    sqInt header4;
     usqInt lastWord;
     sqInt newFreeChunk;
     sqInt newOop;
-    usqInt next;
+    sqInt next;
     sqInt oop;
     sqInt realHeader;
     sqInt sz;
     sqInt sz1;
     sqInt sz2;
+    sqInt sz3;
     sqInt target;
     usqInt w;
 
@@ -23757,7 +23754,21 @@
 		/* begin objectAfterWhileForwarding: */
 		header2 = longAt(oop);
 		if ((header2 & MarkBit) == 0) {
-			next = ((sqInt) (objectAfter(oop)));
+			/* 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]);
 			goto l1;
 		}
 		fwdBlock1 = (header2 & AllButMarkBitAndTypeMask) << 1;
@@ -23772,7 +23783,7 @@
 		else {
 			sz1 = realHeader & SizeMask;
 		}
-		next = ((sqInt) ((oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask])));
+		next = (oop + sz1) + (headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
 	l1:	/* end objectAfterWhileForwarding: */;
 		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
 
@@ -23826,18 +23837,18 @@
 	}
 	/* begin safeObjectAfter: */
 	if (((longAt(newFreeChunk)) & TypeMask) == HeaderTypeFree) {
-		sz2 = (longAt(newFreeChunk)) & AllButTypeMask;
+		sz3 = (longAt(newFreeChunk)) & AllButTypeMask;
 	}
 	else {
 		/* begin sizeBitsOf: */
-		header3 = longAt(newFreeChunk);
-		sz2 = ((header3 & TypeMask) == HeaderTypeSizeAndClass
+		header4 = longAt(newFreeChunk);
+		sz3 = ((header4 & TypeMask) == HeaderTypeSizeAndClass
 			? (longAt(newFreeChunk - (BytesPerWord * 2))) & LongSizeMask
-			: header3 & SizeMask);
+			: header4 & SizeMask);
 	}
-	next = ((newFreeChunk + sz2) >= GIV(freeStart)
+	next = ((newFreeChunk + sz3) >= GIV(freeStart)
 		? GIV(freeStart)
-		: (newFreeChunk + sz2) + (headerTypeBytes[(longAt(newFreeChunk + sz2)) & TypeMask]));
+		: (newFreeChunk + sz3) + (headerTypeBytes[(longAt(newFreeChunk + sz3)) & TypeMask]));
 	assert((next == GIV(freeStart))
 	 || (next == (oopFromChunk(GIV(compEnd)))));
 	if (next == GIV(freeStart)) {
@@ -50047,7 +50058,7 @@
 	given object or free chunk in memory. Return freeStart when
 	enumeration is complete. This is for assertion checking only. */
 
-static usqInt
+static sqInt
 safeObjectAfter(sqInt oop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt header;

Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/interp.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/nscogsrc/vm/vmCallback.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.558 uuid: ef7afd3b-c404-472c-a05a-9d9c6d905052
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 #define VM_CALLBACK_INC 1


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed Dec 11 16:36:32 PST 2013
   + Thu Dec 12 14:52:39 PST 2013

Modified: branches/Cog/platforms/unix/config/make.prg.in
===================================================================
--- branches/Cog/platforms/unix/config/make.prg.in	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/platforms/unix/config/make.prg.in	2013-12-12 22:53:13 UTC (rev 2832)
@@ -2,7 +2,7 @@
 # 
 # Author: Ian.Piumarta at inria.fr
 # 
-# Last edited: Thu Jan 21 14:59:38 PST 2010 by eliot (support for .cpp)
+# Last edited: Thu Dec 12 10:36:03 PST 2013 by eliot (eliminate -R from LINK)
 
 o		= .o
 a		= .a
@@ -16,5 +16,5 @@
 		  $(LDFLAGS) $(XLDFLAGS) -export-dynamic -c -o
 LINK		= $(LIBTOOL) --mode=link \
 		  $(CC) $(CFLAGS) $(XCFLAGS) \
-		  $(LDFLAGS) $(XLDFLAGS) -export-dynamic -R$(libdir) -o
+		  $(LDFLAGS) $(XLDFLAGS) -export-dynamic -o
 RANLIB		= :

Modified: branches/Cog/scripts/findUnofficialFiles
===================================================================
--- branches/Cog/scripts/findUnofficialFiles	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/scripts/findUnofficialFiles	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,4 +1,4 @@
 #!/bin/sh
 # List any files with an un-checked-in package version comment "* VMMaker-..."
-find "${@-src}" -name .svn -prune -o \( -type f -a -name '*.[ch]' \) \
-		-exec fgrep -l '* VMMaker' {} \;
+find ${@-src nscogsrc stacksrc spursrc spurstacksrc} -name .svn -prune -o \( -type f -a -name '*.[ch]' \) \
+		-exec egrep -l '\* VMMaker|\* VMConstruction' {} \;

Modified: branches/Cog/spursrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/cointerp.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spursrc/vm/cointerp.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	CoInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1431,6 +1431,7 @@
 _iss sqInt numClassTablePages;
 _iss sqInt longRunningPrimitiveCheckSemaphore;
 _iss sqInt tempOop;
+_iss char * objStackInvalidBecause;
 _iss SpurNewSpaceSpace eden;
 _iss sqInt profileProcess;
 _iss sqInt profileSemaphore;
@@ -1438,7 +1439,7 @@
 _iss sqInt ephemeronList;
 _iss sqInt needGCFlag;
 _iss sqInt extraRootCount;
-_iss char * objStackInvalidBecause;
+_iss sqInt invalidObjStackPage;
 _iss sqInt previousRememberedSetSize;
 _iss unsigned char * classTableBitmap;
 _iss sqInt longRunningPrimitiveCheckMethod;
@@ -1446,7 +1447,6 @@
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt lkupClass;
 _iss sqInt profileMethod;
-_iss sqInt invalidObjStackPage;
 _iss usqLong nextWakeupUsecs;
 _iss sqInt preemptionYields;
 _iss sqInt cogCompiledCodeCompactionCalledFor;
@@ -2162,7 +2162,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.560]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.561]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -11584,9 +11584,8 @@
 void *
 arrayValueOf(sqInt arrayOop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -20880,9 +20879,8 @@
 
 	arrayOop = longAt((objectPointer + (BaseHeaderSize)) + (fieldIndex << 2));
 	/* begin arrayValueOf: */
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -26608,6 +26606,7 @@
     sqInt freeOrNextPage;
     sqInt index;
     char *ns;
+    sqInt page;
 
 	if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
 		return 0;
@@ -26619,6 +26618,11 @@
 			GIV(invalidObjStackPage) = objStackPage;
 			return 0;
 		}
+		if (freeOrNextPage == (longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) {
+			GIV(objStackInvalidBecause) = "free page = next page";
+			GIV(invalidObjStackPage) = freeOrNextPage;
+			return 0;
+		}
 		if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
 			ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
 			strcpy(ns, GIV(objStackInvalidBecause));
@@ -26626,7 +26630,14 @@
 
 			return 0;
 		}
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		if ((page == freeOrNextPage)
+		 || (page == objStackPage)) {
+			GIV(objStackInvalidBecause) = "circularity in free page list";
+			GIV(invalidObjStackPage) = page;
+			return 0;
+		}
+		freeOrNextPage = page;
 	}
 	if (isFirstPage) {
 		if (!(((myx >= (1 << (22 - 10))) && (myx <= (((1 << (22 - 10)) + 8) - 1))))) {
@@ -26647,8 +26658,15 @@
 		return 0;
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
-	return (freeOrNextPage == 0)
-	 || (isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0));
+	if (freeOrNextPage == 0) {
+		return 1;
+	}
+	if (freeOrNextPage == objStackPage) {
+		GIV(objStackInvalidBecause) = "circularity in objStack page list";
+		GIV(invalidObjStackPage) = objStackPage;
+		return 0;
+	}
+	return isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0);
 }
 
 
@@ -50305,6 +50323,7 @@
     sqInt isFirstPage;
     sqInt isFreePage;
     sqInt isNextPage;
+    sqInt page;
 
 	isFirstPage = pageType == ObjStackMyx;
 	isNextPage = pageType == ObjStackNextx;
@@ -50330,10 +50349,20 @@
 		/* begin cr */
 		printf("\n");
 	}
-	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-	while (freeOrNextPage != 0) {
-		printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+	if (isFirstPage) {
+		freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		while (freeOrNextPage != 0) {
+			printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
+			page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if ((page == freeOrNextPage)
+			 || (page == objStackPage)) {
+				print("circularity in free page list!!");
+				/* begin cr */
+				printf("\n");
+				page = 0;
+			}
+			freeOrNextPage = page;
+		}
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
 	if (freeOrNextPage != 0) {
@@ -56804,6 +56833,7 @@
     sqInt field;
     sqInt firstPage;
     sqInt index;
+    sqInt page;
     sqInt stackOrNil;
 
 	firstPage = (stackOrNil = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2)));
@@ -56825,20 +56855,34 @@
 				/* begin storePointer:ofObjStack:withValue: */
 				assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
 				null;
-				longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+				longAtput((stackOrNil + (BaseHeaderSize)) + (index << 2), field);
 			}
 		} while(((index -= 1)) > ObjStackMyx);
 	} while(((stackOrNil = field)) != 0);
-	while (1) {
-		stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-		if (!(stackOrNil != 0)) break;
-		field = swizzleObj(stackOrNil);
-		/* begin storePointer:ofObjStack:withValue: */
-		assert((formatOf(firstPage)) == (wordIndexableFormat()));
-		null;
-		longAtput((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2), field);
-		firstPage = field;
+	if (((stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2)))) != 0) {
+		while (1) {
+			page = longAt((stackOrNil + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if (!(page != 0)) break;
+			field = swizzleObj(page);
+			/* begin storePointer:ofObjStack:withValue: */
+			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
+			null;
+			longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackFreex << 2), field);
+			stackOrNil = field;
+		}
 	}
+	if (((stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) != 0) {
+		while (1) {
+			page = longAt((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2));
+			if (!(page != 0)) break;
+			field = swizzleObj(page);
+			/* begin storePointer:ofObjStack:withValue: */
+			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
+			null;
+			longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+			stackOrNil = field;
+		}
+	}
 	assert(isValidObjStackAt(objStackRootIndex));
 	return longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2));
 }

Modified: branches/Cog/spursrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursrc/vm/cointerp.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spursrc/vm/cointerp.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 

Modified: branches/Cog/spursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursrc/vm/gcc3x-cointerp.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spursrc/vm/gcc3x-cointerp.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	CoInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1434,6 +1434,7 @@
 _iss sqInt numClassTablePages;
 _iss sqInt longRunningPrimitiveCheckSemaphore;
 _iss sqInt tempOop;
+_iss char * objStackInvalidBecause;
 _iss SpurNewSpaceSpace eden;
 _iss sqInt profileProcess;
 _iss sqInt profileSemaphore;
@@ -1441,7 +1442,7 @@
 _iss sqInt ephemeronList;
 _iss sqInt needGCFlag;
 _iss sqInt extraRootCount;
-_iss char * objStackInvalidBecause;
+_iss sqInt invalidObjStackPage;
 _iss sqInt previousRememberedSetSize;
 _iss unsigned char * classTableBitmap;
 _iss sqInt longRunningPrimitiveCheckMethod;
@@ -1449,7 +1450,6 @@
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt lkupClass;
 _iss sqInt profileMethod;
-_iss sqInt invalidObjStackPage;
 _iss usqLong nextWakeupUsecs;
 _iss sqInt preemptionYields;
 _iss sqInt cogCompiledCodeCompactionCalledFor;
@@ -2165,7 +2165,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.560]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.561]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -11593,9 +11593,8 @@
 void *
 arrayValueOf(sqInt arrayOop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -20889,9 +20888,8 @@
 
 	arrayOop = longAt((objectPointer + (BaseHeaderSize)) + (fieldIndex << 2));
 	/* begin arrayValueOf: */
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -26617,6 +26615,7 @@
     sqInt freeOrNextPage;
     sqInt index;
     char *ns;
+    sqInt page;
 
 	if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
 		return 0;
@@ -26628,6 +26627,11 @@
 			GIV(invalidObjStackPage) = objStackPage;
 			return 0;
 		}
+		if (freeOrNextPage == (longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) {
+			GIV(objStackInvalidBecause) = "free page = next page";
+			GIV(invalidObjStackPage) = freeOrNextPage;
+			return 0;
+		}
 		if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
 			ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
 			strcpy(ns, GIV(objStackInvalidBecause));
@@ -26635,7 +26639,14 @@
 
 			return 0;
 		}
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		if ((page == freeOrNextPage)
+		 || (page == objStackPage)) {
+			GIV(objStackInvalidBecause) = "circularity in free page list";
+			GIV(invalidObjStackPage) = page;
+			return 0;
+		}
+		freeOrNextPage = page;
 	}
 	if (isFirstPage) {
 		if (!(((myx >= (1 << (22 - 10))) && (myx <= (((1 << (22 - 10)) + 8) - 1))))) {
@@ -26656,8 +26667,15 @@
 		return 0;
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
-	return (freeOrNextPage == 0)
-	 || (isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0));
+	if (freeOrNextPage == 0) {
+		return 1;
+	}
+	if (freeOrNextPage == objStackPage) {
+		GIV(objStackInvalidBecause) = "circularity in objStack page list";
+		GIV(invalidObjStackPage) = objStackPage;
+		return 0;
+	}
+	return isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0);
 }
 
 
@@ -50314,6 +50332,7 @@
     sqInt isFirstPage;
     sqInt isFreePage;
     sqInt isNextPage;
+    sqInt page;
 
 	isFirstPage = pageType == ObjStackMyx;
 	isNextPage = pageType == ObjStackNextx;
@@ -50339,10 +50358,20 @@
 		/* begin cr */
 		printf("\n");
 	}
-	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-	while (freeOrNextPage != 0) {
-		printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+	if (isFirstPage) {
+		freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		while (freeOrNextPage != 0) {
+			printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
+			page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if ((page == freeOrNextPage)
+			 || (page == objStackPage)) {
+				print("circularity in free page list!!");
+				/* begin cr */
+				printf("\n");
+				page = 0;
+			}
+			freeOrNextPage = page;
+		}
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
 	if (freeOrNextPage != 0) {
@@ -56813,6 +56842,7 @@
     sqInt field;
     sqInt firstPage;
     sqInt index;
+    sqInt page;
     sqInt stackOrNil;
 
 	firstPage = (stackOrNil = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2)));
@@ -56834,20 +56864,34 @@
 				/* begin storePointer:ofObjStack:withValue: */
 				assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
 				null;
-				longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+				longAtput((stackOrNil + (BaseHeaderSize)) + (index << 2), field);
 			}
 		} while(((index -= 1)) > ObjStackMyx);
 	} while(((stackOrNil = field)) != 0);
-	while (1) {
-		stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-		if (!(stackOrNil != 0)) break;
-		field = swizzleObj(stackOrNil);
-		/* begin storePointer:ofObjStack:withValue: */
-		assert((formatOf(firstPage)) == (wordIndexableFormat()));
-		null;
-		longAtput((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2), field);
-		firstPage = field;
+	if (((stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2)))) != 0) {
+		while (1) {
+			page = longAt((stackOrNil + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if (!(page != 0)) break;
+			field = swizzleObj(page);
+			/* begin storePointer:ofObjStack:withValue: */
+			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
+			null;
+			longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackFreex << 2), field);
+			stackOrNil = field;
+		}
 	}
+	if (((stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) != 0) {
+		while (1) {
+			page = longAt((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2));
+			if (!(page != 0)) break;
+			field = swizzleObj(page);
+			/* begin storePointer:ofObjStack:withValue: */
+			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
+			null;
+			longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+			stackOrNil = field;
+		}
+	}
 	assert(isValidObjStackAt(objStackRootIndex));
 	return longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2));
 }

Modified: branches/Cog/spursrc/vm/interp.h
===================================================================
--- branches/Cog/spursrc/vm/interp.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spursrc/vm/interp.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/spursrc/vm/vmCallback.h
===================================================================
--- branches/Cog/spursrc/vm/vmCallback.h	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spursrc/vm/vmCallback.h	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
 
 #define VM_CALLBACK_INC 1

Modified: branches/Cog/spurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/spurstacksrc/vm/gcc3x-interp.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spurstacksrc/vm/gcc3x-interp.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	StackInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	StackInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1243,6 +1243,7 @@
 _iss sqInt numStackPages;
 _iss sqInt tempOop;
 _iss sqLong nextProfileTick;
+_iss char * objStackInvalidBecause;
 _iss SpurNewSpaceSpace eden;
 _iss sqInt profileProcess;
 _iss sqInt tenureThreshold;
@@ -1250,7 +1251,7 @@
 _iss sqInt needGCFlag;
 _iss sqInt numPages;
 _iss sqInt extraRootCount;
-_iss char * objStackInvalidBecause;
+_iss sqInt invalidObjStackPage;
 _iss sqInt previousRememberedSetSize;
 _iss unsigned char * classTableBitmap;
 _iss sqInt longRunningPrimitiveCheckMethod;
@@ -1259,7 +1260,6 @@
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt profileMethod;
 _iss sqInt growHeadroom;
-_iss sqInt invalidObjStackPage;
 _iss usqLong nextWakeupUsecs;
 _iss sqInt preemptionYields;
 _iss sqInt profileSemaphore;
@@ -1955,7 +1955,7 @@
  0 };
 char * breakSelector;
 sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.560]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.561]";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -12058,9 +12058,8 @@
 void *
 arrayValueOf(sqInt arrayOop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -18782,9 +18781,8 @@
 
 	arrayOop = longAt((objectPointer + (BaseHeaderSize)) + (fieldIndex << 2));
 	/* begin arrayValueOf: */
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -23939,6 +23937,7 @@
     sqInt freeOrNextPage;
     sqInt index;
     char *ns;
+    sqInt page;
 
 	if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
 		return 0;
@@ -23950,6 +23949,11 @@
 			GIV(invalidObjStackPage) = objStackPage;
 			return 0;
 		}
+		if (freeOrNextPage == (longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) {
+			GIV(objStackInvalidBecause) = "free page = next page";
+			GIV(invalidObjStackPage) = freeOrNextPage;
+			return 0;
+		}
 		if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
 			ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
 			strcpy(ns, GIV(objStackInvalidBecause));
@@ -23957,7 +23961,14 @@
 
 			return 0;
 		}
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		if ((page == freeOrNextPage)
+		 || (page == objStackPage)) {
+			GIV(objStackInvalidBecause) = "circularity in free page list";
+			GIV(invalidObjStackPage) = page;
+			return 0;
+		}
+		freeOrNextPage = page;
 	}
 	if (isFirstPage) {
 		if (!(((myx >= (1 << (22 - 10))) && (myx <= (((1 << (22 - 10)) + 8) - 1))))) {
@@ -23978,8 +23989,15 @@
 		return 0;
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
-	return (freeOrNextPage == 0)
-	 || (isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0));
+	if (freeOrNextPage == 0) {
+		return 1;
+	}
+	if (freeOrNextPage == objStackPage) {
+		GIV(objStackInvalidBecause) = "circularity in objStack page list";
+		GIV(invalidObjStackPage) = objStackPage;
+		return 0;
+	}
+	return isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0);
 }
 
 
@@ -46360,6 +46378,7 @@
     sqInt isFirstPage;
     sqInt isFreePage;
     sqInt isNextPage;
+    sqInt page;
 
 	isFirstPage = pageType == ObjStackMyx;
 	isNextPage = pageType == ObjStackNextx;
@@ -46385,10 +46404,20 @@
 		/* begin cr */
 		printf("\n");
 	}
-	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-	while (freeOrNextPage != 0) {
-		printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+	if (isFirstPage) {
+		freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		while (freeOrNextPage != 0) {
+			printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
+			page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if ((page == freeOrNextPage)
+			 || (page == objStackPage)) {
+				print("circularity in free page list!!");
+				/* begin cr */
+				printf("\n");
+				page = 0;
+			}
+			freeOrNextPage = page;
+		}
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
 	if (freeOrNextPage != 0) {
@@ -52350,6 +52379,7 @@
     sqInt field;
     sqInt firstPage;
     sqInt index;
+    sqInt page;
     sqInt stackOrNil;
 
 	firstPage = (stackOrNil = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2)));
@@ -52371,20 +52401,34 @@
 				/* begin storePointer:ofObjStack:withValue: */
 				assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
 				null;
-				longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+				longAtput((stackOrNil + (BaseHeaderSize)) + (index << 2), field);
 			}
 		} while(((index -= 1)) > ObjStackMyx);
 	} while(((stackOrNil = field)) != 0);
-	while (1) {
-		stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-		if (!(stackOrNil != 0)) break;
-		field = swizzleObj(stackOrNil);
-		/* begin storePointer:ofObjStack:withValue: */
-		assert((formatOf(firstPage)) == (wordIndexableFormat()));
-		null;
-		longAtput((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2), field);
-		firstPage = field;
+	if (((stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2)))) != 0) {
+		while (1) {
+			page = longAt((stackOrNil + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if (!(page != 0)) break;
+			field = swizzleObj(page);
+			/* begin storePointer:ofObjStack:withValue: */
+			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
+			null;
+			longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackFreex << 2), field);
+			stackOrNil = field;
+		}
 	}
+	if (((stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) != 0) {
+		while (1) {
+			page = longAt((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2));
+			if (!(page != 0)) break;
+			field = swizzleObj(page);
+			/* begin storePointer:ofObjStack:withValue: */
+			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
+			null;
+			longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+			stackOrNil = field;
+		}
+	}
 	assert(isValidObjStackAt(objStackRootIndex));
 	return longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2));
 }

Modified: branches/Cog/spurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/spurstacksrc/vm/interp.c	2013-12-12 00:38:39 UTC (rev 2831)
+++ branches/Cog/spurstacksrc/vm/interp.c	2013-12-12 22:53:13 UTC (rev 2832)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
    from
-	StackInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f
+	StackInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.560 uuid: db9cf7fa-a7d7-4b48-9e9d-32c8d43e330f " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.561 uuid: 13467880-93b9-4137-9bbc-7ebfd22436ab " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1240,6 +1240,7 @@
 _iss sqInt numStackPages;
 _iss sqInt tempOop;
 _iss sqLong nextProfileTick;
+_iss char * objStackInvalidBecause;
 _iss SpurNewSpaceSpace eden;
 _iss sqInt profileProcess;
 _iss sqInt tenureThreshold;
@@ -1247,7 +1248,7 @@
 _iss sqInt needGCFlag;
 _iss sqInt numPages;
 _iss sqInt extraRootCount;
-_iss char * objStackInvalidBecause;
+_iss sqInt invalidObjStackPage;
 _iss sqInt previousRememberedSetSize;
 _iss unsigned char * classTableBitmap;
 _iss sqInt longRunningPrimitiveCheckMethod;
@@ -1256,7 +1257,6 @@
 _iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt profileMethod;
 _iss sqInt growHeadroom;
-_iss sqInt invalidObjStackPage;
 _iss usqLong nextWakeupUsecs;
 _iss sqInt preemptionYields;
 _iss sqInt profileSemaphore;
@@ -1952,7 +1952,7 @@
  0 };
 char * breakSelector;
 sqInt breakSelectorLength = -1;
-const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.560]";
+const char *interpreterVersion = "Croquet Closure Stack VM [StackInterpreter VMMaker.oscog-eem.561]";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -12049,9 +12049,8 @@
 void *
 arrayValueOf(sqInt arrayOop)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -18773,9 +18772,8 @@
 
 	arrayOop = longAt((objectPointer + (BaseHeaderSize)) + (fieldIndex << 2));
 	/* begin arrayValueOf: */
-	if (((arrayOop & 1) == 0)
-	 && (((arrayOop & 3) == 0)
-	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5))) {
+	if (((arrayOop & 3) == 0)
+	 && (((((usqInt) (longAt(arrayOop))) >> 24) & 0x1F) > 5)) {
 		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
 	}
 	/* begin primitiveFail */
@@ -23930,6 +23928,7 @@
     sqInt freeOrNextPage;
     sqInt index;
     char *ns;
+    sqInt page;
 
 	if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
 		return 0;
@@ -23941,6 +23940,11 @@
 			GIV(invalidObjStackPage) = objStackPage;
 			return 0;
 		}
+		if (freeOrNextPage == (longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2)))) {
+			GIV(objStackInvalidBecause) = "free page = next page";
+			GIV(invalidObjStackPage) = freeOrNextPage;
+			return 0;
+		}
 		if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
 			ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
 			strcpy(ns, GIV(objStackInvalidBecause));
@@ -23948,7 +23952,14 @@
 
 			return 0;
 		}
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		if ((page == freeOrNextPage)
+		 || (page == objStackPage)) {
+			GIV(objStackInvalidBecause) = "circularity in free page list";
+			GIV(invalidObjStackPage) = page;
+			return 0;
+		}
+		freeOrNextPage = page;
 	}
 	if (isFirstPage) {
 		if (!(((myx >= (1 << (22 - 10))) && (myx <= (((1 << (22 - 10)) + 8) - 1))))) {
@@ -23969,8 +23980,15 @@
 		return 0;
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
-	return (freeOrNextPage == 0)
-	 || (isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0));
+	if (freeOrNextPage == 0) {
+		return 1;
+	}
+	if (freeOrNextPage == objStackPage) {
+		GIV(objStackInvalidBecause) = "circularity in objStack page list";
+		GIV(invalidObjStackPage) = objStackPage;
+		return 0;
+	}
+	return isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0);
 }
 
 
@@ -46351,6 +46369,7 @@
     sqInt isFirstPage;
     sqInt isFreePage;
     sqInt isNextPage;
+    sqInt page;
 
 	isFirstPage = pageType == ObjStackMyx;
 	isNextPage = pageType == ObjStackNextx;
@@ -46376,10 +46395,20 @@
 		/* begin cr */
 		printf("\n");
 	}
-	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
-	while (freeOrNextPage != 0) {
-		printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
-		freeOrNextPage = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+	if (isFirstPage) {
+		freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+		while (freeOrNextPage != 0) {
+			printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
+			page = longAt((freeOrNextPage + (BaseHeaderSize)) + (ObjStackFreex << 2));
+			if ((page == freeOrNextPage)
+			 || (page == objStackPage)) {
+				print("circularity in free page list!!");
+				/* begin cr */
+				printf("\n");
+				page = 0;
+			}
+			freeOrNextPage = page;
+		}
 	}
 	freeOrNextPage = longAt((objStackPage + (BaseHeaderSize)) + (ObjStackNextx << 2));
 	if (freeOrNextPage != 0) {
@@ -52341,6 +52370,7 @@
     sqInt field;
     sqInt firstPage;
     sqInt index;
+    sqInt page;
     sqInt stackOrNil;
 
 	firstPage = (stackOrNil = longAt((GIV(hiddenRootsObj) + (BaseHeaderSize)) + (objStackRootIndex << 2)));
@@ -52362,20 +52392,34 @@
 				/* begin storePointer:ofObjStack:withValue: */
 				assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
 				null;
-				longAtput((stackOrNil + (BaseHeaderSize)) + (ObjStackNextx << 2), field);
+				longAtput((stackOrNil + (BaseHeaderSize)) + (index << 2), field);
 			}
 		} while(((index -= 1)) > ObjStackMyx);
 	} while(((stackOrNil = field)) != 0);
-	while (1) {
-		stackOrNil = longAt((firstPage + (BaseHeaderSize)) + (ObjStackFreex << 2));

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list