[Vm-dev] [commit][3323] CogVM source as per VMMaker.oscogglue-eem.1037

commits at squeakvm.org commits at squeakvm.org
Thu May 7 01:47:32 UTC 2015


Revision: 3323
Author:   eliot
Date:     2015-05-06 18:47:30 -0700 (Wed, 06 May 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscogglue-eem.1037

Back port regression fix from VMMaker.oscog-eem.1292

Fix a regression in externalInstVar:ofContext:.  The
head frame pointers must be written back if we're
going to map a machince code pc to a bytecode pc
in case of code reclamation.

Add asserts to the stack page enumerators to check
that the head frame pointers have been written back.

Modified Paths:
--------------
    branches/Glue/nscogsrc/vm/cointerp.c
    branches/Glue/nscogsrc/vm/cointerp.h
    branches/Glue/nscogsrc/vm/gcc3x-cointerp.c
    branches/Glue/nsspursrc/vm/cointerp.c
    branches/Glue/nsspursrc/vm/cointerp.h
    branches/Glue/nsspursrc/vm/gcc3x-cointerp.c
    branches/Glue/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Glue/nsspurstacksrc/vm/interp.c
    branches/Glue/sistasrc/vm/cointerp.c
    branches/Glue/sistasrc/vm/cointerp.h
    branches/Glue/sistasrc/vm/gcc3x-cointerp.c
    branches/Glue/spursistasrc/vm/cointerp.c
    branches/Glue/spursistasrc/vm/cointerp.h
    branches/Glue/spursistasrc/vm/gcc3x-cointerp.c
    branches/Glue/spursrc/vm/cointerp.c
    branches/Glue/spursrc/vm/cointerp.h
    branches/Glue/spursrc/vm/gcc3x-cointerp.c
    branches/Glue/spurstack64src/vm/gcc3x-interp.c
    branches/Glue/spurstack64src/vm/interp.c
    branches/Glue/spurstacksrc/vm/gcc3x-interp.c
    branches/Glue/spurstacksrc/vm/interp.c
    branches/Glue/src/vm/cointerp.c
    branches/Glue/src/vm/cointerp.h
    branches/Glue/src/vm/cointerpmt.c
    branches/Glue/src/vm/cointerpmt.h
    branches/Glue/src/vm/gcc3x-cointerp.c
    branches/Glue/src/vm/gcc3x-cointerpmt.c
    branches/Glue/stacksrc/vm/gcc3x-interp.c
    branches/Glue/stacksrc/vm/interp.c

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

Modified: branches/Glue/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Glue/nscogsrc/vm/cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nscogsrc/vm/cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1104,6 +1104,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2097,7 +2098,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1036";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1037";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -16231,7 +16232,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17284,6 +17297,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -17466,6 +17480,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -17567,6 +17582,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -46471,6 +46487,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Glue/nscogsrc/vm/cointerp.h	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nscogsrc/vm/cointerp.h	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
 
 

Modified: branches/Glue/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Glue/nscogsrc/vm/gcc3x-cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nscogsrc/vm/gcc3x-cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1107,6 +1107,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2100,7 +2101,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1036";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1037";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -16240,7 +16241,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17293,6 +17306,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -17475,6 +17489,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -17576,6 +17591,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -46480,6 +46496,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Glue/nsspursrc/vm/cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nsspursrc/vm/cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1303,6 +1303,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2358,7 +2359,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1036";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1037";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -17620,7 +17621,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17854,6 +17867,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19048,6 +19062,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19909,6 +19924,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -21966,6 +21982,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -66202,6 +66219,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Glue/nsspursrc/vm/cointerp.h	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nsspursrc/vm/cointerp.h	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
 
 

Modified: branches/Glue/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Glue/nsspursrc/vm/gcc3x-cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nsspursrc/vm/gcc3x-cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1306,6 +1306,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2361,7 +2362,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1036";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscogglue-eem.1037";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -17629,7 +17630,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17863,6 +17876,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19057,6 +19071,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19918,6 +19933,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -21975,6 +21991,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -66211,6 +66228,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Glue/nsspurstacksrc/vm/gcc3x-interp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nsspurstacksrc/vm/gcc3x-interp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	StackInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	StackInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1072,6 +1072,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
 static sqInt imageFormatVersion(void);
@@ -2109,7 +2110,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscogglue-eem.1036";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscogglue-eem.1037";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -52225,6 +52226,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -52880,6 +52882,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {
@@ -54911,6 +54940,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -55130,6 +55160,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);

Modified: branches/Glue/nsspurstacksrc/vm/interp.c
===================================================================
--- branches/Glue/nsspurstacksrc/vm/interp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/nsspurstacksrc/vm/interp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	StackInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	StackInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1069,6 +1069,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
 static sqInt imageFormatVersion(void);
@@ -2106,7 +2107,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscogglue-eem.1036";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscogglue-eem.1037";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -52216,6 +52217,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -52871,6 +52873,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {
@@ -54902,6 +54931,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -55121,6 +55151,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);


Property changes on: branches/Glue/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed May  6 14:10:12 PDT 2015
   + Wed May  6 18:46:44 PDT 2015

Modified: branches/Glue/sistasrc/vm/cointerp.c
===================================================================
--- branches/Glue/sistasrc/vm/cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/sistasrc/vm/cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1104,6 +1104,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2098,7 +2099,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1036]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1037]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -16402,7 +16403,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17314,6 +17327,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -17496,6 +17510,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -17597,6 +17612,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -46495,6 +46511,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/sistasrc/vm/cointerp.h
===================================================================
--- branches/Glue/sistasrc/vm/cointerp.h	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/sistasrc/vm/cointerp.h	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
 
 

Modified: branches/Glue/sistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Glue/sistasrc/vm/gcc3x-cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/sistasrc/vm/gcc3x-cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1107,6 +1107,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2101,7 +2102,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1036]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1037]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -16411,7 +16412,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -17323,6 +17336,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -17505,6 +17519,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -17606,6 +17621,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -46504,6 +46520,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/spursistasrc/vm/cointerp.c
===================================================================
--- branches/Glue/spursistasrc/vm/cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/spursistasrc/vm/cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1303,6 +1303,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2359,7 +2360,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1036]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1037]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -17932,7 +17933,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -18166,6 +18179,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19122,6 +19136,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19983,6 +19998,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -22040,6 +22056,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -66219,6 +66236,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/spursistasrc/vm/cointerp.h
===================================================================
--- branches/Glue/spursistasrc/vm/cointerp.h	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/spursistasrc/vm/cointerp.h	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
 
 

Modified: branches/Glue/spursistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Glue/spursistasrc/vm/gcc3x-cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/spursistasrc/vm/gcc3x-cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1306,6 +1306,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2362,7 +2363,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1036]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1037]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -17941,7 +17942,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -18175,6 +18188,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19131,6 +19145,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 
 			/* Skip the instruction pointer on top of stack of inactive pages. */
@@ -19992,6 +20007,7 @@
     char *theSP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 	assert(((thePage->trace)) != StackPageTraced);
 	(thePage->trace = StackPageTraced);
 	theSP = (thePage->headSP);
@@ -22049,6 +22065,7 @@
     char *theFP;
 
 	assert(!(isFree(thePage)));
+	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 
 	/* Skip the instruction pointer on top of stack of inactive pages. */
 
@@ -66228,6 +66245,33 @@
 	return bitNo + shifted;
 }
 
+
+/*	If thePage is the stackPage and the stackPointer and/or the framePointer
+	are pointing within it,
+	answer if thePage's heapSP and headFP are equal to the stackPointer and
+	framePointer respectively.
+ */
+
+static sqInt
+ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+	if (thePage == GIV(stackPage)) {
+		if ((((thePage->lastAddress)) < GIV(framePointer))
+		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headFP)) != GIV(framePointer)) {
+				return 0;
+			}
+		}
+		if ((((thePage->lastAddress)) < GIV(stackPointer))
+		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
+			if (((thePage->headSP)) != GIV(stackPointer)) {
+				return 0;
+			}
+		}
+	}
+	return 1;
+}
+
 static usqInt
 iframeMethod(char *theFP)
 {

Modified: branches/Glue/spursrc/vm/cointerp.c
===================================================================
--- branches/Glue/spursrc/vm/cointerp.c	2015-05-07 01:37:40 UTC (rev 3322)
+++ branches/Glue/spursrc/vm/cointerp.c	2015-05-07 01:47:30 UTC (rev 3323)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CCodeGeneratorGlobalStructure VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
    from
-	CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba
+	CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1036 uuid: 054ce1b0-7472-4245-98f8-cb91bbcf5cba " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscogglue-eem.1037 uuid: 0260edd4-b9e9-48c5-9aa9-4c40339de2ef " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1294,6 +1294,7 @@
 static sqInt handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch) NoDbgRegParms;
 sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
 sqInt highBit(usqInt anUnsignedValue);
+static sqInt ifCurrentStackPageHasValidHeadPointers(StackPage *thePage) NoDbgRegParms;
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
@@ -2348,7 +2349,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1036]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscogglue-eem.1037]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -12921,7 +12922,19 @@
 		return ((offset == InstructionPointerIndex)
 		 && (((value & 1))
 		 && ((((sqInt) value)) < 0))
-			? mustMapMachineCodePCcontext((value >> 1), aContext)
+			? (/* begin externalWriteBackHeadFramePointers */
+				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop)),
+				assert(GIV(stackPage) == (mostRecentlyUsedPage())),
+				/* begin setHeadFP:andSP:inPage: */
+				assert(GIV(stackPointer) < GIV(framePointer)),
+				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop)))),
+				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
+					 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2)))),
+				(GIV(stackPage)->headFP = GIV(framePointer)),
+				(GIV(stackPage)->headSP = GIV(stackPointer)),
+				assert(pageListIsWellFormed()),
+				mustMapMachineCodePCcontext((value >> 1), aContext))
 			: value);
 	}
 	/* begin externalWriteBackHeadFramePointers */
@@ -13155,6 +13168,7 @@
 		/* begin stackPageAt: */
 		thePage = stackPageAtpages(i, GIV(pages));
 		if (!(((thePage->baseFP)) == 0)) {
+			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
 			theSP = (thePage->headSP);
 

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list