[Vm-dev] [commit][2691] CogVM sources as per VMMaker.oscog-eem.265.

commits at squeakvm.org commits at squeakvm.org
Wed Feb 20 17:56:55 UTC 2013


Revision: 2691
Author:   eliot
Date:     2013-02-20 09:56:53 -0800 (Wed, 20 Feb 2013)
Log Message:
-----------
CogVM sources as per VMMaker.oscog-eem.265.

Fix bug in assigning pc which can cause stackPage to not be most recently used.
Fix short frame printing (eliminate an extra newline and use hex for receiver).
Provide a -rh shorthand for -reportheadroom.

Make sqUnixMemory.c compile on BSD (no HAVE_MMAP but still need those includes).

Change the signatures of tenuringIncrementalGC fullGC incrementalGC &
forceInterruptCheck to void return (for Plan 9).

Include the AioPlugin in Squeak Cog VM generation.

Add the -fno-caller-saves info to the Unix HowToBuilds.

Modified Paths:
--------------
    branches/Cog/nscogbuild/unixbuild/HowToBuild
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nscogsrc/vm/interp.h
    branches/Cog/nscogsrc/vm/vmCallback.h
    branches/Cog/platforms/Cross/vm/sqVirtualMachine.c
    branches/Cog/platforms/Cross/vm/sqVirtualMachine.h
    branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c
    branches/Cog/platforms/unix/vm/sqUnixMain.c
    branches/Cog/platforms/unix/vm/sqUnixMemory.c
    branches/Cog/platforms/win32/vm/sqWin32Intel.c
    branches/Cog/platforms/win32/vm/sqWin32Window.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/unixbuild/HowToBuild

Added Paths:
-----------
    branches/Cog/src/plugins/AioPlugin/
    branches/Cog/src/plugins/AioPlugin/AioPlugin.c

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

Modified: branches/Cog/nscogbuild/unixbuild/HowToBuild
===================================================================
--- branches/Cog/nscogbuild/unixbuild/HowToBuild	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/nscogbuild/unixbuild/HowToBuild	2013-02-20 17:56:53 UTC (rev 2691)
@@ -72,6 +72,11 @@
 
 Optimization level and gcc version
 ----------------------------------
+There are issues with gcc version > 4.2.1.  One must include -fno-caller-saves
+with these versions. e.g.
+     ../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g -O2 -msse2 -fno-caller-saves -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread
+See http://smallissimo.blogspot.fr/2013/02/compiling-squeak-cog-virtual-machine-on.html
+
 There appear to be issues with 3.4.x gcc version on RedHat.  In particular
 compiling the Newspeak VM with either of
 	gcc version 3.4.6 20060404 (Red Hat 3.4.6-3)

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
    from
-	CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1192,8 +1192,8 @@
 _iss usqInt method;
 _iss sqInt bytecodeSetSelector;
 _iss usqInt instructionPointer;
-_iss sqInt argumentCount;
 _iss sqInt nilObj;
+_iss sqInt argumentCount;
 _iss usqInt freeStart;
 _iss sqInt messageSelector;
 _iss usqInt newMethod;
@@ -1939,7 +1939,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static usqInt heapBase;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.264";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.265";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5608,6 +5608,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l5:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -12004,6 +12006,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l262:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -12154,6 +12158,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l263:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -30153,13 +30159,6 @@
     sqInt successBoolean8;
     sqInt successBoolean9;
 
-	flag("Dan");
-	if (BytesPerWord == 8) {
-		/* begin pop: */
-		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
-		null;
-		return;
-	}
 	if (GIV(argumentCount) == 0) {
 		cursorObj = longAt(GIV(stackPointer));
 		maskBitsIndex = null;
@@ -44801,14 +44800,13 @@
 	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
 		printFrameAndCallersSPshort(frameCallerFP(theFP), frameCallerSP(theFP), printShort);
 	}
-	/* begin cr */
-	printf("\n");
 	if (printShort) {
 		shortPrintFrame(theFP);
+		return;
 	}
-	else {
-		printFrameWithSP(theFP, theSP);
-	}
+	/* begin cr */
+	printf("\n");
+	printFrameWithSP(theFP, theSP);
 }
 
 static void
@@ -48659,7 +48657,7 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
 
-	printNum(oop);
+	printHex(oop);
 	if ((oop & 1)) {
 		printf("=%ld\n", (long)integerValueOf(oop)); return;
 	}

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
    from
-	CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1195,8 +1195,8 @@
 _iss usqInt method;
 _iss sqInt bytecodeSetSelector;
 _iss usqInt instructionPointer;
-_iss sqInt argumentCount;
 _iss sqInt nilObj;
+_iss sqInt argumentCount;
 _iss usqInt freeStart;
 _iss sqInt messageSelector;
 _iss usqInt newMethod;
@@ -1942,7 +1942,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static usqInt heapBase;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.264";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.265";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5617,6 +5617,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l5:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -12013,6 +12015,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l262:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -12163,6 +12167,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l263:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -30162,13 +30168,6 @@
     sqInt successBoolean8;
     sqInt successBoolean9;
 
-	flag("Dan");
-	if (BytesPerWord == 8) {
-		/* begin pop: */
-		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
-		null;
-		return;
-	}
 	if (GIV(argumentCount) == 0) {
 		cursorObj = longAt(GIV(stackPointer));
 		maskBitsIndex = null;
@@ -44810,14 +44809,13 @@
 	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
 		printFrameAndCallersSPshort(frameCallerFP(theFP), frameCallerSP(theFP), printShort);
 	}
-	/* begin cr */
-	printf("\n");
 	if (printShort) {
 		shortPrintFrame(theFP);
+		return;
 	}
-	else {
-		printFrameWithSP(theFP, theSP);
-	}
+	/* begin cr */
+	printf("\n");
+	printFrameWithSP(theFP, theSP);
 }
 
 static void
@@ -48668,7 +48666,7 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
 
-	printNum(oop);
+	printHex(oop);
 	if ((oop & 1)) {
 		printf("=%ld\n", (long)integerValueOf(oop)); return;
 	}

Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/nscogsrc/vm/interp.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/nscogsrc/vm/vmCallback.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
 
 #define VM_CALLBACK_INC 1


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Tue Feb  5 18:53:21 PST 2013
   + Wed Feb 20 09:51:28 PST 2013

Modified: branches/Cog/platforms/Cross/vm/sqVirtualMachine.c
===================================================================
--- branches/Cog/platforms/Cross/vm/sqVirtualMachine.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/Cross/vm/sqVirtualMachine.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -77,7 +77,7 @@
 sqInt primitiveErrorTable(void);
 sqInt primitiveFailureCode(void);
 sqInt instanceSizeOf(sqInt aClass);
-sqInt tenuringIncrementalGC(void);
+void tenuringIncrementalGC(void);
 #endif
 sqInt isArray(sqInt oop);
 sqInt isOopMutable(sqInt oop);
@@ -138,8 +138,8 @@
 sqInt byteSwapped(sqInt w);
 sqInt failed(void);
 sqInt fullDisplayUpdate(void);
-sqInt fullGC(void);
-sqInt incrementalGC(void);
+void fullGC(void);
+void incrementalGC(void);
 sqInt primitiveFail(void);
 sqInt primitiveFailFor(sqInt reasonCode);
 sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
@@ -148,7 +148,7 @@
 sqInt superclassOf(sqInt classPointer);
 sqInt ioMicroMSecs(void);
 usqLong ioUTCMicroseconds(void);
-sqInt forceInterruptCheck(void);
+void forceInterruptCheck(void);
 sqInt getThisSessionID(void);
 sqInt ioFilenamefromStringofLengthresolveAliases(char* aCharBuffer, char* filenameIndex, sqInt filenameLength, sqInt resolveFlag);
 sqInt vmEndianness(void);	

Modified: branches/Cog/platforms/Cross/vm/sqVirtualMachine.h
===================================================================
--- branches/Cog/platforms/Cross/vm/sqVirtualMachine.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/Cross/vm/sqVirtualMachine.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -154,8 +154,8 @@
 	sqInt (*byteSwapped)(sqInt w);
 	sqInt (*failed)(void);
 	sqInt (*fullDisplayUpdate)(void);
-	sqInt (*fullGC)(void);
-	sqInt (*incrementalGC)(void);
+	void (*fullGC)(void);
+	void (*incrementalGC)(void);
 	sqInt (*primitiveFail)(void);
 	sqInt (*showDisplayBitsLeftTopRightBottom)(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
 	sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
@@ -226,13 +226,13 @@
 
 #if VM_PROXY_MINOR > 5
 	sqInt (*isArray)(sqInt oop);
-	sqInt (*forceInterruptCheck)(void);
+	void (*forceInterruptCheck)(void);
 #endif
 
 #if VM_PROXY_MINOR > 6
 	sqInt  (*fetchLong32ofObject)(sqInt fieldFieldIndex, sqInt oop);
 	sqInt  (*getThisSessionID)(void);
-	sqInt	  (*ioFilenamefromStringofLengthresolveAliases)(char* aCharBuffer, char* filenameIndex, sqInt filenameLength, sqInt resolveFlag);
+	sqInt  (*ioFilenamefromStringofLengthresolveAliases)(char* aCharBuffer, char* filenameIndex, sqInt filenameLength, sqInt resolveFlag);
 	sqInt  (*vmEndianness)(void);	
 #endif
 
@@ -296,7 +296,7 @@
   void  (*addHighPriorityTickee)(void (*ticker)(void), unsigned periodms);
   void  (*addSynchronousTickee)(void (*ticker)(void), unsigned periodms, unsigned roundms);
   usqLong (*utcMicroseconds)(void);
-  sqInt (*tenuringIncrementalGC)(void);
+  void (*tenuringIncrementalGC)(void);
   sqInt (*isYoung) (sqInt anOop);
   sqInt (*isKindOfClass)(sqInt oop, sqInt aClass);
   sqInt (*primitiveErrorTable)(void);

Modified: branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c
===================================================================
--- branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/Mac OS/vm/sqMacUnixCommandLineInterface.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -242,7 +242,8 @@
 		extern sqInt minBackwardJumpCountForCompile;
 		minBackwardJumpCountForCompile = strtobkm(argv[1]);	 
 		return 2; }
-      else if (!strcmp(argv[0], "-reportheadroom")) { 
+      else if (!strcmp(argv[0], "-reportheadroom")
+			|| !strcmp(argv[0], "-rh")) { 
 		extern sqInt reportStackHeadroom;
 		reportStackHeadroom = 1;
 		return 1; }
@@ -304,6 +305,7 @@
   printf("  -tracestores          enable store tracing (assert check stores)\n");
   printf("  -cogmaxlits <n>       set max number of literals for methods to be compiled to machine code\n");
   printf("  -cogminjumps <n>      set min number of backward jumps for interpreted methods to be considered for compilation to machine code\n");
+  printf("  -reportheadroom       report unused stack headroom on exit\n");
 #endif
 #if STACKVM || NewspeakVM
   printf("  -breaksel selector    call warning when sending or jitting selector\n");

Modified: branches/Cog/platforms/unix/vm/sqUnixMain.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMain.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/unix/vm/sqUnixMain.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1401,7 +1401,8 @@
 		extern sqInt minBackwardJumpCountForCompile;
 		minBackwardJumpCountForCompile = strtobkm(argv[1]);	 
 		return 2; }
-      else if (!strcmp(argv[0], "-reportheadroom")) { 
+      else if (!strcmp(argv[0], "-reportheadroom")
+			|| !strcmp(argv[0], "-rh")) { 
 		extern sqInt reportStackHeadroom;
 		reportStackHeadroom = 1;
 		return 1; }
@@ -1462,6 +1463,7 @@
   printf("  -tracestores          enable store tracing (assert check stores)\n");
   printf("  -cogmaxlits <n>       set max number of literals for methods compiled to machine code\n");
   printf("  -cogminjumps <n>      set min number of backward jumps for interpreted methods to be considered for compilation to machine code\n");
+  printf("  -reportheadroom       report unused stack headroom on exit\n");
 #endif
   printf("  -blockonerror         on error or segv block, not exit.  useful for attaching gdb\n");
 #if 1

Modified: branches/Cog/platforms/unix/vm/sqUnixMemory.c
===================================================================
--- branches/Cog/platforms/unix/vm/sqUnixMemory.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/unix/vm/sqUnixMemory.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -45,6 +45,11 @@
  *   option to allocate a fixed size heap.
  */
 
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/mman.h>
 
 #include "sq.h"
 #include "sqMemoryAccess.h"
@@ -61,11 +66,6 @@
 
 #if defined(HAVE_MMAP)
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/mman.h>
 #include <fcntl.h>
 
 #if !defined(MAP_ANON)

Modified: branches/Cog/platforms/win32/vm/sqWin32Intel.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Intel.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/win32/vm/sqWin32Intel.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1723,17 +1723,18 @@
 		return 2; }
 	else if (!strncmp(argv[0], "-cogmaxlits:", 12)) { 
 		extern sqInt maxLiteralCountForCompile;
-		maxLiteralCountForCompile = strtobkm(argv[0]+12);	 
+		maxLiteralCountForCompile = strtobkm(argv[0]+12); 
 		return 2; }
 	else if (argc > 1 && !strcmp(argv[0], "-cogminjumps")) { 
 		extern sqInt minBackwardJumpCountForCompile;
-		minBackwardJumpCountForCompile = strtobkm(argv[1]);	 
+		minBackwardJumpCountForCompile = strtobkm(argv[1]); 
 		return 2; }
 	else if (!strncmp(argv[0], "-cogminjumps:",13)) { 
 		extern sqInt minBackwardJumpCountForCompile;
-		minBackwardJumpCountForCompile = strtobkm(argv[0]+13);	 
+		minBackwardJumpCountForCompile = strtobkm(argv[0]+13); 
 		return 2; }
-    else if (!strcmp(argv[0], "-reportheadroom")) { 
+    else if (!strcmp(argv[0], "-reportheadroom")
+          || !strcmp(argv[0], "-rh")) { 
 		extern sqInt reportStackHeadroom;
 		reportStackHeadroom = 1;
 		return 1; }

Modified: branches/Cog/platforms/win32/vm/sqWin32Window.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Window.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/platforms/win32/vm/sqWin32Window.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -346,7 +346,7 @@
 	timeDelta = timeNow - lastClickTime;
 	nrClicks = (timeDelta <= GetDoubleClickTime()) ? (nrClicks + 1) : 1;
 	lastClickTime = timeNow;
-	
+
     if(inputSemaphoreIndex) {
       recordMouseEvent(lastMessage, nrClicks);
       break;
@@ -357,11 +357,11 @@
     /* check for console focus */
     recordMouseDown(wParam, lParam);
     recordModifierButtons();
-	
+
 	/* capture the mouse as long as the button is pressed so we can scroll outside */
     SetCapture(stWindow);
     break;
-	
+
   case WM_LBUTTONUP:
   case WM_RBUTTONUP:
   case WM_MBUTTONUP:
@@ -3217,6 +3217,7 @@
                    TEXT("\n\t-cogmaxlits: n \t(set max number of literals for methods to be compiled to machine code)")
                    TEXT("\n\t-cogminjumps: n \t(set min number of backward jumps for interpreted methods to be considered for compilation to machine code)")
                    TEXT("\n\t-tracestores \t(assert-check stores for debug)")
+                   TEXT("\n\t-reportheadroom\t(report unused stack headroom on exit)");
                    TEXT("\n\t-dpcso: bytes \t(stack offset for prim calls for debug)")
 #endif /* COGVM */
                    );

Added: branches/Cog/src/plugins/AioPlugin/AioPlugin.c
===================================================================
--- branches/Cog/src/plugins/AioPlugin/AioPlugin.c	                        (rev 0)
+++ branches/Cog/src/plugins/AioPlugin/AioPlugin.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -0,0 +1,730 @@
+/* Automatically generated by
+	VMPluginCodeGenerator VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
+   from
+	UnixAioPlugin VMConstruction-Plugins-AioPlugin-dtl.14 uuid: 965d54b7-4309-42fd-adb0-64400d3c780b
+ */
+static char __buildInfo[] = "UnixAioPlugin VMConstruction-Plugins-AioPlugin-dtl.14 uuid: 965d54b7-4309-42fd-adb0-64400d3c780b " __DATE__ ;
+
+
+
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+#define FILEHANDLETYPE FILE *  /* the type of low level stream to be used in a struct SQFile */
+
+/* Default EXPORT macro that does nothing (see comment in sq.h): */
+#define EXPORT(returnType) returnType
+
+/* Do not include the entire sq.h file but just those parts needed. */
+/*  The virtual machine proxy definition */
+#include "sqVirtualMachine.h"
+/* Configuration options */
+#include "sqConfig.h"
+/* Platform specific definitions */
+#include "sqPlatformSpecific.h"
+
+#define true 1
+#define false 0
+#define null 0  /* using 'null' because nil is predefined in Think C */
+#ifdef SQUEAK_BUILTIN_PLUGIN
+#undef EXPORT
+// was #undef EXPORT(returnType) but screws NorCroft cc
+#define EXPORT(returnType) static returnType
+#endif
+
+#include "FilePlugin.h"
+#include "SocketPlugin.h"
+#include "config.h"
+#define SESSIONIDENTIFIERTYPE int
+#include "sqaio.h"
+#include "sqMemoryAccess.h"
+
+
+/*** Constants ***/
+#define BytesPerWord 4
+
+
+/*** Function Prototypes ***/
+static void aioForwardwithDataandFlags(int fd, void *data, int flags);
+static sqInt fileDescriptorFrom(sqInt aSQFileByteArray);
+static FILEHANDLETYPE fileHandleFrom(sqInt sqFileStructByteArray);
+static sqInt fileRecordSize(void);
+static SQFile * fileValueOf(sqInt anSQFileRecord);
+static VirtualMachine * getInterpreter(void);
+EXPORT(const char*) getModuleName(void);
+static sqInt getThisSessionIdentifier(void);
+static sqInt halt(void);
+EXPORT(sqInt) initialiseModule(void);
+static sqInt isNonNullSQFile(sqInt objectPointer);
+static sqInt isNullSQSocket(sqInt objectPointer);
+static sqInt isSQFileObject(sqInt objectPointer);
+static sqInt isSQSocketObject(sqInt objectPointer);
+static sqInt isValidFileSession(sqInt objectPointer);
+EXPORT(sqInt) moduleUnloaded(char *aModuleName);
+static sqInt msg(char *s);
+EXPORT(sqInt) primitiveAioDisable(void);
+EXPORT(sqInt) primitiveAioEnable(void);
+EXPORT(sqInt) primitiveAioHandle(void);
+EXPORT(sqInt) primitiveAioSuspend(void);
+EXPORT(sqInt) primitiveModuleName(void);
+EXPORT(sqInt) primitiveOSFileHandle(void);
+EXPORT(sqInt) primitiveOSSocketHandle(void);
+EXPORT(sqInt) primitiveVersionString(void);
+static SESSIONIDENTIFIERTYPE sessionIdentifierFromSqFile(SQFile *sqFile);
+EXPORT(sqInt) setInterpreter(struct VirtualMachine*anInterpreter);
+EXPORT(sqInt) shutdownModule(void);
+static int socketDescriptorFrom(sqInt sqSocketOop);
+static sqInt socketRecordSize(void);
+static SQSocket * socketValueOf(sqInt anSQSocketRecord);
+static sqInt stringFromCString(const char *aCString);
+static char * versionString(void);
+
+
+/*** Variables ***/
+
+#if !defined(SQUEAK_BUILTIN_PLUGIN)
+static void * (*arrayValueOf)(sqInt oop);
+static sqInt (*byteSizeOf)(sqInt oop);
+static sqInt (*classString)(void);
+static sqInt (*getThisSessionID)(void);
+static sqInt (*instantiateClassindexableSize)(sqInt classPointer, sqInt size);
+static sqInt (*isBytes)(sqInt oop);
+static sqInt (*nilObject)(void);
+static sqInt (*pop)(sqInt nItems);
+static sqInt (*popthenPush)(sqInt nItems, sqInt oop);
+static sqInt (*primitiveFail)(void);
+static sqInt (*pushInteger)(sqInt integerValue);
+static sqInt (*signalSemaphoreWithIndex)(sqInt semaIndex);
+static sqInt (*stackIntegerValue)(sqInt offset);
+static sqInt (*stackObjectValue)(sqInt offset);
+static sqInt (*stackValue)(sqInt offset);
+static sqInt (*trueObject)(void);
+#else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
+extern void * arrayValueOf(sqInt oop);
+extern sqInt byteSizeOf(sqInt oop);
+extern sqInt classString(void);
+extern sqInt getThisSessionID(void);
+extern sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size);
+extern sqInt isBytes(sqInt oop);
+extern sqInt nilObject(void);
+extern sqInt pop(sqInt nItems);
+extern sqInt popthenPush(sqInt nItems, sqInt oop);
+extern sqInt primitiveFail(void);
+extern sqInt pushInteger(sqInt integerValue);
+extern sqInt signalSemaphoreWithIndex(sqInt semaIndex);
+extern sqInt stackIntegerValue(sqInt offset);
+extern sqInt stackObjectValue(sqInt offset);
+extern sqInt stackValue(sqInt offset);
+extern sqInt trueObject(void);
+
+extern
+#endif
+struct VirtualMachine* interpreterProxy;
+static const char *moduleName =
+#ifdef SQUEAK_BUILTIN_PLUGIN
+	"AioPlugin VMConstruction-Plugins-AioPlugin-dtl.14 (i)"
+#else
+	"AioPlugin VMConstruction-Plugins-AioPlugin-dtl.14 (e)"
+#endif
+;
+
+
+
+/*	This function is called to signal a Smalltalk Semaphore when an
+	asynchronous event is
+	detected. When translated to C, the name of this method is
+	aioForwardwithDataandFlags. The event handler is set up by
+	#primitiveAioHandle. 
+ */
+
+static void
+aioForwardwithDataandFlags(int fd, void *data, int flags)
+{
+    int *pfd;
+    sqInt semaIndex;
+
+	pfd = data;
+	semaIndex = *pfd;
+	signalSemaphoreWithIndex(semaIndex);
+}
+
+
+/*	Answer the OS file descriptor, an integer value, from a SQFile data
+	structure byte array, or answer -1 if unable to obtain the file descriptor
+	(probably due
+	to receiving an incorrect type of object as aFileHandle).
+ */
+/*	return type should be int, but skip the declaration to permit inlining */
+
+static sqInt
+fileDescriptorFrom(sqInt aSQFileByteArray)
+{
+	if (!((((isBytes(aSQFileByteArray))
+ && ((byteSizeOf(aSQFileByteArray)) == (fileRecordSize())))
+ && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(aSQFileByteArray)))))
+		 && (isNonNullSQFile(aSQFileByteArray)))) {
+		return -1;
+	}
+	return fileno(fileHandleFrom(aSQFileByteArray));
+}
+
+
+/*	Answer a file handle from a SQFile structure. On most platforms, this
+	will be a (FILE *). On Win32, it is a HANDLE. */
+
+static FILEHANDLETYPE
+fileHandleFrom(sqInt sqFileStructByteArray)
+{
+    SQFile *sqFile;
+
+	sqFile = arrayValueOf(sqFileStructByteArray);
+	return sqFile->file;
+}
+
+
+/*	Answer the size of a SQFile data structure in bytes. */
+
+static sqInt
+fileRecordSize(void)
+{
+	return sizeof(SQFile);
+}
+
+
+/*	Return a pointer to the first byte of of the SQFile data structure file
+	record within
+	anSQFileRecord, which is expected to be a ByteArray of size
+	self>>fileRecordSize. 
+ */
+
+static SQFile *
+fileValueOf(sqInt anSQFileRecord)
+{
+	return arrayValueOf(anSQFileRecord);
+}
+
+
+/*	Note: This is coded so that plugins can be run from Squeak. */
+
+static VirtualMachine *
+getInterpreter(void)
+{
+	return interpreterProxy;
+}
+
+
+/*	Note: This is hardcoded so it can be run from Squeak.
+	The module name is used for validating a module *after*
+	it is loaded to check if it does really contain the module
+	we're thinking it contains. This is important! */
+
+EXPORT(const char*)
+getModuleName(void)
+{
+	return moduleName;
+}
+
+static sqInt
+getThisSessionIdentifier(void)
+{
+	return getThisSessionID();
+}
+
+static sqInt
+halt(void)
+{
+	;
+	return 0;
+}
+
+EXPORT(sqInt)
+initialiseModule(void)
+{
+	return 1;
+}
+
+
+/*	Check for the common failure mode of a SQFile record with all zeros. */
+
+static sqInt
+isNonNullSQFile(sqInt objectPointer)
+{
+    sqInt idx;
+    unsigned char *sqFileBytes;
+
+	sqFileBytes = arrayValueOf(objectPointer);
+	idx = 0;
+	while (idx < (fileRecordSize())) {
+		if ((sqFileBytes[idx]) != 0) {
+			return 1;
+		}
+		idx += 1;
+	}
+	return 0;
+}
+
+
+/*	Check for the common failure mode of a SQSocket record with all zeros. */
+
+static sqInt
+isNullSQSocket(sqInt objectPointer)
+{
+    sqInt idx;
+    unsigned char *sqSocketBytes;
+
+	sqSocketBytes = arrayValueOf(objectPointer);
+	idx = 0;
+	while (idx < (socketRecordSize())) {
+		if ((sqSocketBytes[idx]) != 0) {
+			return 0;
+		}
+		idx += 1;
+	}
+	return 1;
+}
+
+
+/*	Answer true if objectPointer appears to be a valid SQFile ByteArray.
+	This check is appropriate if objectPointer has been passed as a parameter
+	to a primitive, and is expected to represent a valid file reference. */
+
+static sqInt
+isSQFileObject(sqInt objectPointer)
+{
+	return (((isBytes(objectPointer))
+ && ((byteSizeOf(objectPointer)) == (fileRecordSize())))
+ && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(objectPointer)))))
+	 && (isNonNullSQFile(objectPointer));
+}
+
+
+/*	Answer true if objectPointer appears to be a valid SQSocket ByteArray.
+	This check
+	is appropriate if objectPointer has been passed as a parameter to a
+	primitive, and
+	is expected to represent a valid socket reference.
+ */
+
+static sqInt
+isSQSocketObject(sqInt objectPointer)
+{
+	return ((isBytes(objectPointer))
+ && ((byteSizeOf(objectPointer)) == (socketRecordSize())))
+	 && (!(isNullSQSocket(objectPointer)));
+}
+
+
+/*	Answer true if the file session matches the current interpreter session
+	identifier. 
+ */
+
+static sqInt
+isValidFileSession(sqInt objectPointer)
+{
+	return (getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(objectPointer)));
+}
+
+
+/*	The module with the given name was just unloaded.
+	Make sure we have no dangling references. */
+
+EXPORT(sqInt)
+moduleUnloaded(char *aModuleName)
+{
+}
+
+static sqInt
+msg(char *s)
+{
+	fprintf(stderr, "\n%s: %s", moduleName, s);
+	return 0;
+}
+
+
+/*	Definitively disable asynchronous event notification for a descriptor. The
+	parameter is an OS level integer file descriptor. */
+
+EXPORT(sqInt)
+primitiveAioDisable(void)
+{
+    sqInt fd;
+
+	if ((nilObject()) == (stackValue(0))) {
+		return primitiveFail();
+	}
+	fd = stackIntegerValue(0);
+	if (fd < 0) {
+		return primitiveFail();
+	}
+	aioDisable(fd);
+	pop(2);
+	pushInteger(fd);
+}
+
+
+/*	Enable asynchronous notification for a descriptor. The first parameter is
+	an OS
+	level integer file descriptor. The second parameter is the index of a
+	Semaphore to
+	be notified, and the third parameter is a flag indicating that descriptor
+	represents an external object and should not be closed on termination of
+	aio handling. Answer
+	the semaphore index.
+ */
+
+EXPORT(sqInt)
+primitiveAioEnable(void)
+{
+    static int eventSemaphoreIndices[FD_SETSIZE];
+    sqInt externalObject;
+    sqInt fd;
+    sqInt flags;
+    sqInt semaIndex;
+
+	if ((nilObject()) == (stackValue(2))) {
+		return primitiveFail();
+	}
+	fd = stackIntegerValue(2);
+	if (fd < 0) {
+		return primitiveFail();
+	}
+	semaIndex = stackIntegerValue(1);
+	eventSemaphoreIndices[semaIndex] = semaIndex;
+	externalObject = stackObjectValue(0);
+	if (externalObject == (trueObject())) {
+		flags = AIO_EXT;
+	}
+	else {
+		flags = 0;
+	}
+	aioEnable(fd, &(eventSemaphoreIndices[semaIndex]), flags);
+	pop(4);
+	pushInteger(semaIndex);
+}
+
+
+/*	Handle asynchronous event notification for a descriptor. The first
+	parameter is
+	an OS level integer file descriptor. The remaining three parameters are
+	Boolean flags representing the types of events for which notification is
+	being requested:
+	handle exceptions, handle for read, and handle for write.
+	Flags are defined in the aio.h source as:
+	AIO_X	(1<<0)	handle for exceptions
+	AIO_R	(1<<1)	handle for read
+	AIO_W	(1<<2)	handle for write */
+
+EXPORT(sqInt)
+primitiveAioHandle(void)
+{
+    sqInt exceptionWatch;
+    sqInt fd;
+    sqInt flags;
+    sqInt readWatch;
+    sqInt writeWatch;
+
+	if ((nilObject()) == (stackValue(3))) {
+		return primitiveFail();
+	}
+	fd = stackIntegerValue(3);
+	if (fd < 0) {
+		return primitiveFail();
+	}
+	exceptionWatch = stackObjectValue(2);
+	readWatch = stackObjectValue(1);
+	writeWatch = stackObjectValue(0);
+	flags = 0;
+	if (exceptionWatch == (trueObject())) {
+		flags = flags | (AIO_X);
+	}
+	if (readWatch == (trueObject())) {
+		flags = flags | (AIO_R);
+	}
+	if (writeWatch == (trueObject())) {
+		flags = flags | (AIO_W);
+	}
+	aioHandle(fd, aioForwardwithDataandFlags, flags);
+	pop(5);
+	pushInteger(flags);
+}
+
+
+/*	Temporarily suspend asynchronous event notification for a descriptor. The
+	first parameter is an OS level integer file descriptor. The remaining
+	three parameters
+	are Boolean flags representing the types of events for which notification
+	is being
+	requested: handle exceptions, handle for read, and handle for write.
+	Flags are defined in the aio.h source as:
+	AIO_X	(1<<0)	handle for exceptions
+	AIO_R	(1<<1)	handle for read
+	AIO_W	(1<<2)	handle for write */
+
+EXPORT(sqInt)
+primitiveAioSuspend(void)
+{
+    sqInt exceptionWatch;
+    sqInt fd;
+    sqInt flags;
+    sqInt readWatch;
+    sqInt writeWatch;
+
+	if ((nilObject()) == (stackValue(3))) {
+		return primitiveFail();
+	}
+	fd = stackIntegerValue(3);
+	if (fd < 0) {
+		return primitiveFail();
+	}
+	exceptionWatch = stackObjectValue(2);
+	readWatch = stackObjectValue(1);
+	writeWatch = stackObjectValue(0);
+	flags = 0;
+	if (exceptionWatch == (trueObject())) {
+		flags = flags | (AIO_X);
+	}
+	if (readWatch == (trueObject())) {
+		flags = flags | (AIO_R);
+	}
+	if (writeWatch == (trueObject())) {
+		flags = flags | (AIO_W);
+	}
+	aioSuspend(fd, flags);
+	pop(5);
+	pushInteger(flags);
+}
+
+
+/*	Answer a string containing the module name string for this plugin. */
+
+EXPORT(sqInt)
+primitiveModuleName(void)
+{
+	popthenPush(1, stringFromCString(getModuleName()));
+}
+
+
+/*	Take a struct SQFile from the stack, and answer the value of its Unix file
+	number. 
+ */
+
+EXPORT(sqInt)
+primitiveOSFileHandle(void)
+{
+    sqInt fileNo;
+    sqInt sqFileOop;
+
+	sqFileOop = stackValue(0);
+	if (!((((isBytes(sqFileOop))
+ && ((byteSizeOf(sqFileOop)) == (fileRecordSize())))
+ && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop)))))
+		 && (isNonNullSQFile(sqFileOop)))) {
+		return primitiveFail();
+	}
+	/* begin fileDescriptorFrom: */
+	if (!((((isBytes(sqFileOop))
+ && ((byteSizeOf(sqFileOop)) == (fileRecordSize())))
+ && ((getThisSessionID()) == (sessionIdentifierFromSqFile(arrayValueOf(sqFileOop)))))
+		 && (isNonNullSQFile(sqFileOop)))) {
+		fileNo = -1;
+		goto l1;
+	}
+	fileNo = fileno(fileHandleFrom(sqFileOop));
+l1:	/* end fileDescriptorFrom: */;
+	pop(2);
+	pushInteger(fileNo);
+}
+
+
+/*	Take a struct SQSocket from the stack, and answer the value of its Unix
+	file number.
+ */
+
+EXPORT(sqInt)
+primitiveOSSocketHandle(void)
+{
+    sqInt fileNo;
+    sqInt sqSocketOop;
+
+	sqSocketOop = stackValue(0);
+	if (!(((isBytes(sqSocketOop))
+ && ((byteSizeOf(sqSocketOop)) == (socketRecordSize())))
+		 && (!(isNullSQSocket(sqSocketOop))))) {
+		return primitiveFail();
+	}
+	fileNo = socketDescriptorFrom(sqSocketOop);
+	if (fileNo < 0) {
+		return primitiveFail();
+	}
+	pop(2);
+	pushInteger(fileNo);
+}
+
+
+/*	Answer a string containing the version string for this plugin. */
+
+EXPORT(sqInt)
+primitiveVersionString(void)
+{
+	popthenPush(1, stringFromCString(versionString()));
+}
+
+
+/*	Answer the session identifier from a SQFile structure. For a valid file
+	reference, this identifier will match the session identifier supplied by
+	the interpreter. */
+
+static SESSIONIDENTIFIERTYPE
+sessionIdentifierFromSqFile(SQFile *sqFile)
+{
+	return sqFile->sessionID;
+}
+
+
+/*	Note: This is coded so that it can be run in Squeak. */
+
+EXPORT(sqInt)
+setInterpreter(struct VirtualMachine*anInterpreter)
+{
+    sqInt ok;
+
+	interpreterProxy = anInterpreter;
+	ok = ((interpreterProxy->majorVersion()) == (VM_PROXY_MAJOR))
+	 && ((interpreterProxy->minorVersion()) >= (VM_PROXY_MINOR));
+	if (ok) {
+		
+#if !defined(SQUEAK_BUILTIN_PLUGIN)
+		arrayValueOf = interpreterProxy->arrayValueOf;
+		byteSizeOf = interpreterProxy->byteSizeOf;
+		classString = interpreterProxy->classString;
+		getThisSessionID = interpreterProxy->getThisSessionID;
+		instantiateClassindexableSize = interpreterProxy->instantiateClassindexableSize;
+		isBytes = interpreterProxy->isBytes;
+		nilObject = interpreterProxy->nilObject;
+		pop = interpreterProxy->pop;
+		popthenPush = interpreterProxy->popthenPush;
+		primitiveFail = interpreterProxy->primitiveFail;
+		pushInteger = interpreterProxy->pushInteger;
+		signalSemaphoreWithIndex = interpreterProxy->signalSemaphoreWithIndex;
+		stackIntegerValue = interpreterProxy->stackIntegerValue;
+		stackObjectValue = interpreterProxy->stackObjectValue;
+		stackValue = interpreterProxy->stackValue;
+		trueObject = interpreterProxy->trueObject;
+#endif /* !defined(SQUEAK_BUILTIN_PLUGIN) */
+	}
+	return ok;
+}
+
+EXPORT(sqInt)
+shutdownModule(void)
+{
+}
+
+
+/*	Answer the OS file descriptor, an integer value, from a SQSocket data
+	structure, or answer -1 if unable to obtain the file descriptor (probably
+	due to receiving
+	an incorrect type of object as aFileHandle).
+	
+	Warning: The first element of privateSocketStruct happens to be the Unix
+	file number of the socket. See sqUnixSocket.c for the definition. This
+	method takes
+	advantage of this, and will break if anyone ever redefines the data
+	structure. 
+ */
+
+static int
+socketDescriptorFrom(sqInt sqSocketOop)
+{
+    void *privateSocketStruct;
+    SQSocket *sqSocket;
+
+	/* begin socketValueOf: */
+	sqSocket = arrayValueOf(sqSocketOop);
+	privateSocketStruct = sqSocket->privateSocketPtr;
+	if (privateSocketStruct == 0) {
+		return -1;
+	}
+	return * (int *) privateSocketStruct;
+}
+
+
+/*	Answer the size of a SQSocket data structure in bytes. */
+
+static sqInt
+socketRecordSize(void)
+{
+	return sizeof(SQSocket);
+}
+
+
+/*	Return a pointer to the first byte of of the SQsocket data structure
+	socket record within
+	anSQSocketRecord, which is expected to be a ByteArray of size
+	self>>socketRecordSize. 
+ */
+
+static SQSocket *
+socketValueOf(sqInt anSQSocketRecord)
+{
+	return arrayValueOf(anSQSocketRecord);
+}
+
+
+/*	Answer a new String copied from a null-terminated C string.
+	Caution: This may invoke the garbage collector. */
+
+static sqInt
+stringFromCString(const char *aCString)
+{
+    sqInt len;
+    sqInt newString;
+
+	len = strlen(aCString);
+	newString = instantiateClassindexableSize(classString(), len);
+	strncpy(arrayValueOf(newString), aCString, len);
+	return newString;
+}
+
+
+/*	Answer a string containing the version string for this plugin. Handle MNU
+	errors, which can occur if class InterpreterPlugin has been removed from
+	the system.
+	
+	Important: When this method is changed, the class side method must also be
+	changed to match.
+ */
+/*	2.0 supports 64bit code base */
+
+static char *
+versionString(void)
+{
+    static char version[]= "2.2.6";
+
+	return version;
+}
+
+
+#ifdef SQUEAK_BUILTIN_PLUGIN
+
+void* AioPlugin_exports[][3] = {
+	{"AioPlugin", "getModuleName", (void*)getModuleName},
+	{"AioPlugin", "initialiseModule", (void*)initialiseModule},
+	{"AioPlugin", "moduleUnloaded", (void*)moduleUnloaded},
+	{"AioPlugin", "primitiveAioDisable", (void*)primitiveAioDisable},
+	{"AioPlugin", "primitiveAioEnable", (void*)primitiveAioEnable},
+	{"AioPlugin", "primitiveAioHandle", (void*)primitiveAioHandle},
+	{"AioPlugin", "primitiveAioSuspend", (void*)primitiveAioSuspend},
+	{"AioPlugin", "primitiveModuleName", (void*)primitiveModuleName},
+	{"AioPlugin", "primitiveOSFileHandle", (void*)primitiveOSFileHandle},
+	{"AioPlugin", "primitiveOSSocketHandle", (void*)primitiveOSSocketHandle},
+	{"AioPlugin", "primitiveVersionString", (void*)primitiveVersionString},
+	{"AioPlugin", "setInterpreter", (void*)setInterpreter},
+	{"AioPlugin", "shutdownModule", (void*)shutdownModule},
+	{NULL, NULL, NULL}
+};
+
+#endif /* ifdef SQ_BUILTIN_PLUGIN */

Modified: branches/Cog/src/vm/cointerp.c
===================================================================
--- branches/Cog/src/vm/cointerp.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/cointerp.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
    from
-	CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1929,7 +1929,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.264]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.265]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5444,6 +5444,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l5:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -25701,13 +25703,6 @@
     sqInt successBoolean8;
     sqInt successBoolean9;
 
-	flag("Dan");
-	if (BytesPerWord == 8) {
-		/* begin pop: */
-		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
-		null;
-		return;
-	}
 	if (GIV(argumentCount) == 0) {
 		cursorObj = longAt(GIV(stackPointer));
 		maskBitsIndex = null;
@@ -40287,14 +40282,13 @@
 	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
 		printFrameAndCallersSPshort(frameCallerFP(theFP), frameCallerSP(theFP), printShort);
 	}
-	/* begin cr */
-	printf("\n");
 	if (printShort) {
 		shortPrintFrame(theFP);
+		return;
 	}
-	else {
-		printFrameWithSP(theFP, theSP);
-	}
+	/* begin cr */
+	printf("\n");
+	printFrameWithSP(theFP, theSP);
 }
 
 static void
@@ -44111,7 +44105,7 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
 
-	printNum(oop);
+	printHex(oop);
 	if ((oop & 1)) {
 		printf("=%ld\n", (long)integerValueOf(oop)); return;
 	}

Modified: branches/Cog/src/vm/cointerp.h
===================================================================
--- branches/Cog/src/vm/cointerp.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/cointerp.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
 
 

Modified: branches/Cog/src/vm/cointerpmt.c
===================================================================
--- branches/Cog/src/vm/cointerpmt.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/cointerpmt.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
    from
-	CoInterpreterMT VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CoInterpreterMT VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
-static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2028,7 +2028,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.264]";
+const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.265]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 sqInt willNotThreadWarnCount;
@@ -5545,6 +5545,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l5:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -26939,13 +26941,6 @@
     sqInt successBoolean8;
     sqInt successBoolean9;
 
-	flag("Dan");
-	if (BytesPerWord == 8) {
-		/* begin pop: */
-		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
-		null;
-		return;
-	}
 	if (GIV(argumentCount) == 0) {
 		cursorObj = longAt(GIV(stackPointer));
 		maskBitsIndex = null;
@@ -41636,14 +41631,13 @@
 	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
 		printFrameAndCallersSPshort(frameCallerFP(theFP), frameCallerSP(theFP), printShort);
 	}
-	/* begin cr */
-	printf("\n");
 	if (printShort) {
 		shortPrintFrame(theFP);
+		return;
 	}
-	else {
-		printFrameWithSP(theFP, theSP);
-	}
+	/* begin cr */
+	printf("\n");
+	printFrameWithSP(theFP, theSP);
 }
 
 static void
@@ -45561,7 +45555,7 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
 
-	printNum(oop);
+	printHex(oop);
 	if ((oop & 1)) {
 		printf("=%ld\n", (long)integerValueOf(oop)); return;
 	}

Modified: branches/Cog/src/vm/cointerpmt.h
===================================================================
--- branches/Cog/src/vm/cointerpmt.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/cointerpmt.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
 
 

Modified: branches/Cog/src/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/src/vm/gcc3x-cointerp.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/gcc3x-cointerp.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
    from
-	CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1932,7 +1932,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.264]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreter VMMaker.oscog-eem.265]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5453,6 +5453,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l5:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -25710,13 +25712,6 @@
     sqInt successBoolean8;
     sqInt successBoolean9;
 
-	flag("Dan");
-	if (BytesPerWord == 8) {
-		/* begin pop: */
-		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
-		null;
-		return;
-	}
 	if (GIV(argumentCount) == 0) {
 		cursorObj = longAt(GIV(stackPointer));
 		maskBitsIndex = null;
@@ -40296,14 +40291,13 @@
 	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
 		printFrameAndCallersSPshort(frameCallerFP(theFP), frameCallerSP(theFP), printShort);
 	}
-	/* begin cr */
-	printf("\n");
 	if (printShort) {
 		shortPrintFrame(theFP);
+		return;
 	}
-	else {
-		printFrameWithSP(theFP, theSP);
-	}
+	/* begin cr */
+	printf("\n");
+	printFrameWithSP(theFP, theSP);
 }
 
 static void
@@ -44120,7 +44114,7 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
 
-	printNum(oop);
+	printHex(oop);
 	if ((oop & 1)) {
 		printf("=%ld\n", (long)integerValueOf(oop)); return;
 	}

Modified: branches/Cog/src/vm/gcc3x-cointerpmt.c
===================================================================
--- branches/Cog/src/vm/gcc3x-cointerpmt.c	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/gcc3x-cointerpmt.c	2013-02-20 17:56:53 UTC (rev 2691)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
    from
-	CoInterpreterMT VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d
+	CoInterpreterMT VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239
  */
-static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d " __DATE__ ;
+static char __buildInfo[] = "CoInterpreterMT VMMaker.oscog-eem.265 uuid: c8c5b4d1-706a-4eb6-ad85-566811e2b239 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -2031,7 +2031,7 @@
  0 };
 static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
 static usqInt heapBase;
-const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.264]";
+const char *interpreterVersion = "Croquet Closure Cog MT VM [CoInterpreterMT VMMaker.oscog-eem.265]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 sqInt willNotThreadWarnCount;
@@ -5554,6 +5554,8 @@
 					localIP = pointerForOop(GIV(instructionPointer));
 					localSP = pointerForOop(GIV(stackPointer));
 					localFP = pointerForOop(GIV(framePointer));
+					markStackPageMostRecentlyUsed(GIV(stackPage));
+					assertValidExecutionPointersimbar(localIP, localFP, localSP, 1);
 				l5:	/* end instVar:ofContext:put: */;
 				}
 				else {
@@ -26948,13 +26950,6 @@
     sqInt successBoolean8;
     sqInt successBoolean9;
 
-	flag("Dan");
-	if (BytesPerWord == 8) {
-		/* begin pop: */
-		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
-		null;
-		return;
-	}
 	if (GIV(argumentCount) == 0) {
 		cursorObj = longAt(GIV(stackPointer));
 		maskBitsIndex = null;
@@ -41645,14 +41640,13 @@
 	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
 		printFrameAndCallersSPshort(frameCallerFP(theFP), frameCallerSP(theFP), printShort);
 	}
-	/* begin cr */
-	printf("\n");
 	if (printShort) {
 		shortPrintFrame(theFP);
+		return;
 	}
-	else {
-		printFrameWithSP(theFP, theSP);
-	}
+	/* begin cr */
+	printf("\n");
+	printFrameWithSP(theFP, theSP);
 }
 
 static void
@@ -45570,7 +45564,7 @@
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt ccIndex;
 
-	printNum(oop);
+	printHex(oop);
 	if ((oop & 1)) {
 		printf("=%ld\n", (long)integerValueOf(oop)); return;
 	}

Modified: branches/Cog/src/vm/interp.h
===================================================================
--- branches/Cog/src/vm/interp.h	2013-02-18 01:06:10 UTC (rev 2690)
+++ branches/Cog/src/vm/interp.h	2013-02-20 17:56:53 UTC (rev 2691)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.264 uuid: 64e76092-8af7-449f-9188-e65f3bd1f08d

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list