[Vm-dev] [commit][3384] CogVM source as per VMMaker.oscog-eem.1367

commits at squeakvm.org commits at squeakvm.org
Sat Jun 20 03:36:46 UTC 2015


Revision: 3384
Author:   eliot
Date:     2015-06-19 20:36:45 -0700 (Fri, 19 Jun 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1367

Fix PIC parsing for out-of-line literals.  Add an assert to the closed PIC
prototype code to check all PIC parameters are accessible.  Add a
containsAddress: to abstract away the test for a target within the PIC.

Modified Paths:
--------------
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogitARMv5.c
    branches/Cog/spursistasrc/vm/cogitIA32.c
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogitARMv5.c
    branches/Cog/spursrc/vm/cogitIA32.c
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogitARMv5.c
    branches/Cog/src/vm/cogitIA32.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

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

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-06-20 03:36:45 UTC (rev 3384)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c
+	CCodeGenerator VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
  */
 
 
@@ -57,7 +57,6 @@
 extern sqInt minCogMethodAddress(void);
 extern sqInt mnuOffset(void);
 extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
-extern sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
 extern void printCogMethodFor(void *address);
 extern void printTrampolineTable(void);
 extern sqInt recordPrimTraceFunc(void);

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-20 03:36:45 UTC (rev 3384)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c
+	CCodeGenerator VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -606,11 +606,13 @@
 static void computeMaximumSizes(void);
 static sqInt cPICHasForwardedClass(CogMethod *cPIC) NoDbgRegParms;
 static sqInt cPICHasFreedTargets(CogMethod *cPIC) NoDbgRegParms;
+static sqInt cPICPrototypeCaseOffset(void);
 static sqInt cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod) NoDbgRegParms;
 static AbstractInstruction * gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder) NoDbgRegParms;
 extern sqInt defaultCogCodeSize(void);
 static sqInt endPCOf(sqInt aMethod) NoDbgRegParms;
 extern void enterCogCodePopReceiver(void);
+static sqInt expectedClosedPICPrototype(CogMethod *cPIC) NoDbgRegParms;
 static sqInt extABytecode(void);
 static sqInt extBBytecode(void);
 static sqInt fillInBlockHeadersAt(sqInt startAddress) NoDbgRegParms;
@@ -725,7 +727,6 @@
 static AbstractInstruction * gPopR(sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gPushCw(sqInt wordConstant) NoDbgRegParms;
 extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
-extern sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
 static sqInt picAbortDiscriminatorValue(void);
 static sqInt picInterpretAbortOffset(void);
 static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
@@ -927,12 +928,12 @@
 static AbstractInstruction * allocateLiteral(sqInt aLiteral) NoDbgRegParms;
 static AbstractInstruction * checkLiteralforInstruction(sqInt literal, AbstractInstruction *anInstruction) NoDbgRegParms;
 static AbstractInstruction * checkQuickConstantforInstruction(sqInt literal, AbstractInstruction *anInstruction) NoDbgRegParms;
-static sqInt classRefInClosedPICAt(sqInt mcpc) NoDbgRegParms;
+static sqInt classRefInClosedPICAt(sqInt address) NoDbgRegParms;
 static sqInt dumpLiterals(sqInt generateBranchAround) NoDbgRegParms;
 static sqInt literalInstructionInRange(AbstractInstruction *litInst) NoDbgRegParms;
 static AbstractInstruction * locateLiteral(sqInt aLiteral) NoDbgRegParms;
 static sqInt mustDumpLiterals(sqInt currentOpcodeIndex) NoDbgRegParms;
-static sqInt objRefInClosedPICAt(sqInt mcpc) NoDbgRegParms;
+static sqInt objRefInClosedPICAt(sqInt address) NoDbgRegParms;
 static sqInt resetForBlockCompile(void);
 static sqInt saveForBlockCompile(void);
 static sqInt compileBlockDispatch(void);
@@ -8495,7 +8496,6 @@
     sqInt entryPoint;
     sqInt i;
     sqInt object;
-    sqInt offsetToJump;
     sqInt offsetToLiteral;
     sqInt pc;
     CogMethod *targetMethod;
@@ -8510,7 +8510,6 @@
 
 	pc = (((sqInt)cPIC)) + firstCPICCaseOffset;
 	offsetToLiteral = jumpLongByteSize(backEnd);
-	offsetToJump = BytesPerOop;
 	for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) {
 		;
 		object = longAt(pc - offsetToLiteral);
@@ -8518,16 +8517,17 @@
 		 && (!(isMarked(object)))) {
 			return 1;
 		}
+		offsetToLiteral = jumpLongConditionalByteSize(backEnd);
 
 		/* Find target from jump.  Ignore jumps to the interpret and MNU calls within this PIC */
 
-		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), (pc - offsetToJump) - ((i <= 1
+		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc - ((i <= 1
 	? BytesPerOop
 	: BytesPerOop + 4)));
 		assert((entryPoint > methodZoneBase)
 		 && (entryPoint < (freeStart())));
-		if (((((usqInt)entryPoint)) < (((usqInt)cPIC)))
-		 || ((((usqInt)entryPoint)) > (((usqInt)((((usqInt)cPIC)) + ((cPIC->blockSize))))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			assert((((targetMethod->cmType)) == CMMethod)
 			 || (((targetMethod->cmType)) == CMFree));
@@ -8535,8 +8535,6 @@
 				return 1;
 			}
 		}
-		offsetToLiteral = jumpLongConditionalByteSize(backEnd);
-		offsetToJump = BytesPerOop + 4;
 		pc += cPICCaseSize;
 	}
 	return 0;
@@ -9712,7 +9710,7 @@
 {
     sqInt classIndex;
     sqInt i;
-    usqInt pc;
+    sqInt pc;
 
 	pc = (((((usqInt)cPIC)) + firstCPICCaseOffset) + cPICCaseSize) - (jumpLongConditionalByteSize(backEnd));
 	for (i = 2; i <= ((cPIC->cPICNumCases)); i += 1) {
@@ -9742,8 +9740,8 @@
 		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc - ((i <= 1
 	? BytesPerOop
 	: BytesPerOop + 4)));
-		if ((entryPoint < (((sqInt)cPIC)))
-		 || (entryPoint > ((((sqInt)cPIC)) + ((cPIC->blockSize))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			assert((((targetMethod->cmType)) == CMMethod)
 			 || (((targetMethod->cmType)) == CMFree));
@@ -9756,6 +9754,18 @@
 	return 0;
 }
 
+
+/*	Whimsey; we want 16rCA5E10 + cPICPrototypeCaseOffset to be somewhere in
+	the middle of the zone.
+ */
+
+	/* Cogit>>#cPICPrototypeCaseOffset */
+static sqInt
+cPICPrototypeCaseOffset(void)
+{
+	return ((methodZoneBase + (youngReferrers())) / 2) - 13262352;
+}
+
 	/* Cogit>>#cPIC:HasTarget: */
 static sqInt
 cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod)
@@ -9866,6 +9876,55 @@
 }
 
 
+/*	Answer 0 if the ClosedPIC is as expected from compileClosedPICPrototype,
+	otherwise answer an error code identifying the first discrepancy found. */
+
+	/* Cogit>>#expectedClosedPICPrototype: */
+static sqInt
+expectedClosedPICPrototype(CogMethod *cPIC)
+{
+    sqInt entryPoint;
+    sqInt i;
+    sqInt object;
+    sqInt offsetToLiteral;
+    sqInt pc;
+
+
+	/* First jump is unconditional; subsequent ones are conditional */
+
+	pc = (((sqInt)cPIC)) + firstCPICCaseOffset;
+	offsetToLiteral = jumpLongByteSize(backEnd);
+	for (i = 1; i <= numPICCases; i += 1) {
+		if (i > 1) {
+			object = longAt((pc - offsetToLiteral) - BytesPerOop);
+			if (!(object == ((3133021973UL + i) - 1))) {
+				return 1;
+			}
+		}
+		object = longAt(pc - offsetToLiteral);
+		if (!(object == ((i == 1
+	? 99282957
+	: (195929424 + i) - 1)))) {
+			return 2;
+		}
+		offsetToLiteral = jumpLongConditionalByteSize(backEnd);
+		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc - ((i <= 1
+	? BytesPerOop
+	: BytesPerOop + 4)));
+		if (!(entryPoint == (((cPICPrototypeCaseOffset()) + 13262352) + ((i - 1) * 16)))) {
+			return 3;
+		}
+		pc += cPICCaseSize;
+	}
+	pc -= cPICCaseSize;
+	entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc + cPICEndSize);
+	if (!(entryPoint == (cPICMissTrampolineFor(0)))) {
+		return 4;
+	}
+	return 0;
+}
+
+
 /*	224		11100000	aaaaaaaa	Extend A (Ext A = Ext A prev * 256 + Ext A) */
 
 	/* Cogit>>#extABytecode */
@@ -10424,12 +10483,15 @@
 {
     AbstractInstruction *anInstruction;
     AbstractInstruction *anInstruction1;
+    CogMethod *cPIC;
     sqInt fixupSize;
     sqInt h;
     AbstractInstruction *inst;
     AbstractInstruction *inst1;
     AbstractInstruction *jumpNext;
     sqInt jumpTarget;
+    sqInt jumpTarget1;
+    sqInt jumpTarget2;
     sqInt numArgs;
     sqInt opcodeSize;
     sqInt wordConstant;
@@ -10462,7 +10524,8 @@
 	(anInstruction1->dependent = allocateLiteral(99282957));
 	anInstruction1;
 	/* begin DumpJumpLong: */
-	inst1 = genoperand(JumpLong, ((sqInt)(methodZoneBase + 13262352)));
+	jumpTarget1 = (cPICPrototypeCaseOffset()) + 13262352;
+	inst1 = genoperand(JumpLong, ((sqInt)jumpTarget1));
 	dumpLiterals(0);
 	inst1;
 	jmpTarget(jumpNext, (endCPICCase0 = gLabel()));
@@ -10478,7 +10541,8 @@
 		(anInstruction->dependent = allocateLiteral(195929424 + h));
 		anInstruction;
 		/* begin DumpJumpLongZero: */
-		inst = genoperand(JumpLongZero, ((sqInt)(13262352 + (h * 16))));
+		jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16);
+		inst = genoperand(JumpLongZero, ((sqInt)jumpTarget));
 		dumpLiterals(0);
 		inst;
 		if (h == 1) {
@@ -10491,16 +10555,19 @@
 	/* begin gen:literal:operand: */
 	checkLiteralforInstruction(wordConstant, genoperandoperand(MoveCwR, wordConstant, ClassReg));
 	/* begin JumpLong: */
-	jumpTarget = cPICMissTrampolineFor(numArgs);
-	genoperand(JumpLong, jumpTarget);
+	jumpTarget2 = cPICMissTrampolineFor(numArgs);
+	genoperand(JumpLong, jumpTarget2);
 	0;
 	computeMaximumSizes();
+	cPIC = ((CogMethod *) methodZoneBase);
 	closedPICSize = (sizeof(CogMethod)) + (generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))));
+	outputInstructionsAt(methodZoneBase + (sizeof(CogMethod)));
 	firstCPICCaseOffset = ((endCPICCase0->address)) - methodZoneBase;
 	cPICCaseSize = ((endCPICCase1->address)) - ((endCPICCase0->address));
 	cPICEndSize = closedPICSize - (((numPICCases - 1) * cPICCaseSize) + firstCPICCaseOffset);
 	closedPICSize = roundUpLength(closedPICSize);
 	assert(((picInterpretAbort->address)) == (((methodLabel->address)) + (picInterpretAbortOffset())));
+	assert((expectedClosedPICPrototype(cPIC)) == 0);
 }
 
 
@@ -10619,12 +10686,12 @@
 generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
 {
     unsigned char annotation;
-    usqInt delta;
+    sqInt delta;
     sqInt i;
     AbstractInstruction *instruction;
     sqInt length;
-    usqInt location;
-    usqInt mapEntry;
+    sqInt location;
+    sqInt mapEntry;
     sqInt maxDelta;
     usqInt mcpc;
 
@@ -13190,8 +13257,8 @@
 		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc - ((i <= 1
 	? BytesPerOop
 	: BytesPerOop + 4)));
-		if ((entryPoint < (((sqInt)cPIC)))
-		 || (entryPoint > ((((sqInt)cPIC)) + ((cPIC->blockSize))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			if (((targetMethod->cmType)) != CMMethod) {
 				return 0;
@@ -13314,14 +13381,7 @@
 	return 1;
 }
 
-	/* Cogit>>#pc:isWithinMethod: */
-sqInt
-pcisWithinMethod(char *address, CogMethod *cogMethod)
-{
-	return (((((sqInt)address)) >= ((((sqInt)cogMethod)) + (sizeof(CogMethod)))) && ((((sqInt)address)) <= ((((sqInt)cogMethod)) + ((cogMethod->blockSize)))));
-}
 
-
 /*	This value is used to decide between MNU processing
 	or interpretation in the closed PIC aborts. */
 
@@ -13800,8 +13860,8 @@
 		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc - ((i <= 1
 	? BytesPerOop
 	: BytesPerOop + 4)));
-		if ((entryPoint < (((sqInt)cPIC)))
-		 || (entryPoint > ((((sqInt)cPIC)) + ((cPIC->blockSize))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			assert(((targetMethod->cmType)) == CMMethod);
 			/* begin cPICCase:relocateJumpLongBefore:by: */
@@ -15011,7 +15071,8 @@
 	subject = remapOop(object);
 	if (object != subject) {
 		/* begin storeClassRef:inClosedPICAt: */
-		longAtput(mcpc - BytesPerOop, subject);
+		longAt(mcpc - BytesPerOop);
+
 		codeModified = 1;
 	}
 	return isYoungObject(subject);
@@ -20324,11 +20385,14 @@
 	return anInstruction;
 }
 
+
+/*	If inline cache tags are not objects they will be 32-bit values. */
+
 	/* OutOfLineLiteralsManager>>#classRefInClosedPICAt: */
 static sqInt
-classRefInClosedPICAt(sqInt mcpc)
+classRefInClosedPICAt(sqInt address)
 {
-	return longAt(mcpc - BytesPerOop);
+	return longAt(address - BytesPerOop);
 }
 
 
@@ -20466,9 +20530,9 @@
 
 	/* OutOfLineLiteralsManager>>#objRefInClosedPICAt: */
 static sqInt
-objRefInClosedPICAt(sqInt mcpc)
+objRefInClosedPICAt(sqInt address)
 {
-	return longAt(mcpc);
+	return longAt(address);
 }
 
 	/* OutOfLineLiteralsManager>>#resetForBlockCompile */

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-20 03:36:45 UTC (rev 3384)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c
+	CCodeGenerator VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1366 uuid: caed09f8-bf82-445d-b581-1d65e2b6882c " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -558,11 +558,13 @@
 static void computeMaximumSizes(void);
 static sqInt cPICHasForwardedClass(CogMethod *cPIC) NoDbgRegParms;
 static sqInt cPICHasFreedTargets(CogMethod *cPIC) NoDbgRegParms;
+static sqInt cPICPrototypeCaseOffset(void);
 static sqInt cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod) NoDbgRegParms;
 static AbstractInstruction * gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder) NoDbgRegParms;
 extern sqInt defaultCogCodeSize(void);
 static sqInt endPCOf(sqInt aMethod) NoDbgRegParms;
 extern void enterCogCodePopReceiver(void);
+static sqInt expectedClosedPICPrototype(CogMethod *cPIC) NoDbgRegParms;
 static sqInt extABytecode(void);
 static sqInt extBBytecode(void);
 static sqInt fillInBlockHeadersAt(sqInt startAddress) NoDbgRegParms;
@@ -676,7 +678,6 @@
 static AbstractInstruction * gPopR(sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gPushCw(sqInt wordConstant) NoDbgRegParms;
 extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
-extern sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
 static sqInt picAbortDiscriminatorValue(void);
 static sqInt picInterpretAbortOffset(void);
 static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
@@ -7839,7 +7840,6 @@
     sqInt entryPoint;
     sqInt i;
     sqInt object;
-    sqInt offsetToJump;
     sqInt offsetToLiteral;
     sqInt pc;
     CogMethod *targetMethod;
@@ -7854,7 +7854,6 @@
 
 	pc = (((sqInt)cPIC)) + firstCPICCaseOffset;
 	offsetToLiteral = jumpLongByteSize(backEnd);
-	offsetToJump = 0;
 	for (i = 1; i <= ((cPIC->cPICNumCases)); i += 1) {
 		;
 		object = literalBeforeFollowingAddress(backEnd(), pc - offsetToLiteral);
@@ -7862,14 +7861,15 @@
 		 && (!(isMarked(object)))) {
 			return 1;
 		}
+		offsetToLiteral = jumpLongConditionalByteSize(backEnd);
 
 		/* Find target from jump.  Ignore jumps to the interpret and MNU calls within this PIC */
 
-		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc - offsetToJump);
+		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc);
 		assert((entryPoint > methodZoneBase)
 		 && (entryPoint < (freeStart())));
-		if (((((usqInt)entryPoint)) < (((usqInt)cPIC)))
-		 || ((((usqInt)entryPoint)) > (((usqInt)((((usqInt)cPIC)) + ((cPIC->blockSize))))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			assert((((targetMethod->cmType)) == CMMethod)
 			 || (((targetMethod->cmType)) == CMFree));
@@ -7877,8 +7877,6 @@
 				return 1;
 			}
 		}
-		offsetToLiteral = jumpLongConditionalByteSize(backEnd);
-		offsetToJump = 0;
 		pc += cPICCaseSize;
 	}
 	return 0;
@@ -9074,8 +9072,8 @@
 		/* Find target from jump.  Ignore jumps to the interpret and MNU calls within this PIC */
 
 		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc);
-		if ((entryPoint < (((sqInt)cPIC)))
-		 || (entryPoint > ((((sqInt)cPIC)) + ((cPIC->blockSize))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			assert((((targetMethod->cmType)) == CMMethod)
 			 || (((targetMethod->cmType)) == CMFree));
@@ -9088,6 +9086,18 @@
 	return 0;
 }
 
+
+/*	Whimsey; we want 16rCA5E10 + cPICPrototypeCaseOffset to be somewhere in
+	the middle of the zone.
+ */
+
+	/* Cogit>>#cPICPrototypeCaseOffset */
+static sqInt
+cPICPrototypeCaseOffset(void)
+{
+	return ((methodZoneBase + (youngReferrers())) / 2) - 13262352;
+}
+
 	/* Cogit>>#cPIC:HasTarget: */
 static sqInt
 cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod)
@@ -9196,6 +9206,53 @@
 }
 
 
+/*	Answer 0 if the ClosedPIC is as expected from compileClosedPICPrototype,
+	otherwise answer an error code identifying the first discrepancy found. */
+
+	/* Cogit>>#expectedClosedPICPrototype: */
+static sqInt
+expectedClosedPICPrototype(CogMethod *cPIC)
+{
+    sqInt entryPoint;
+    sqInt i;
+    sqInt object;
+    sqInt offsetToLiteral;
+    sqInt pc;
+
+
+	/* First jump is unconditional; subsequent ones are conditional */
+
+	pc = (((sqInt)cPIC)) + firstCPICCaseOffset;
+	offsetToLiteral = jumpLongByteSize(backEnd);
+	for (i = 1; i <= numPICCases; i += 1) {
+		if (i > 1) {
+			object = literalBeforeFollowingAddress(backEnd(), (pc - offsetToLiteral) - (loadLiteralByteSize(backEnd())));
+			if (!(object == ((3133021973UL + i) - 1))) {
+				return 1;
+			}
+		}
+		object = literalBeforeFollowingAddress(backEnd(), pc - offsetToLiteral);
+		if (!(object == ((i == 1
+	? 99282957
+	: (195929424 + i) - 1)))) {
+			return 2;
+		}
+		offsetToLiteral = jumpLongConditionalByteSize(backEnd);
+		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc);
+		if (!(entryPoint == (((cPICPrototypeCaseOffset()) + 13262352) + ((i - 1) * 16)))) {
+			return 3;
+		}
+		pc += cPICCaseSize;
+	}
+	pc -= cPICCaseSize;
+	entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd, pc + cPICEndSize);
+	if (!(entryPoint == (cPICMissTrampolineFor(0)))) {
+		return 4;
+	}
+	return 0;
+}
+
+
 /*	224		11100000	aaaaaaaa	Extend A (Ext A = Ext A prev * 256 + Ext A) */
 
 	/* Cogit>>#extABytecode */
@@ -9767,12 +9824,15 @@
     AbstractInstruction *anInstruction1;
     AbstractInstruction *anInstruction2;
     AbstractInstruction *anInstruction3;
+    CogMethod *cPIC;
     sqInt fixupSize;
     sqInt h;
     AbstractInstruction *inst;
     AbstractInstruction *inst1;
     AbstractInstruction *jumpNext;
     sqInt jumpTarget;
+    sqInt jumpTarget1;
+    sqInt jumpTarget2;
     sqInt literal;
     sqInt numArgs;
     sqInt opcodeSize;
@@ -9804,7 +9864,8 @@
 	anInstruction2 = genoperandoperand(MoveCwR, 99282957, SendNumArgsReg);
 	anInstruction2;
 	/* begin DumpJumpLong: */
-	inst1 = genoperand(JumpLong, ((sqInt)(methodZoneBase + 13262352)));
+	jumpTarget1 = (cPICPrototypeCaseOffset()) + 13262352;
+	inst1 = genoperand(JumpLong, ((sqInt)jumpTarget1));
 	/* begin dumpLiterals: */
 	inst1;
 	jmpTarget(jumpNext, (endCPICCase0 = gLabel()));
@@ -9821,7 +9882,8 @@
 		anInstruction1 = genoperandoperand(MoveCwR, 195929424 + h, SendNumArgsReg);
 		anInstruction1;
 		/* begin DumpJumpLongZero: */
-		inst = genoperand(JumpLongZero, ((sqInt)(13262352 + (h * 16))));
+		jumpTarget = ((cPICPrototypeCaseOffset()) + 13262352) + (h * 16);
+		inst = genoperand(JumpLongZero, ((sqInt)jumpTarget));
 		/* begin dumpLiterals: */
 		inst;
 		if (h == 1) {
@@ -9836,16 +9898,19 @@
 	anInstruction3 = genoperandoperand(MoveCwR, wordConstant, ClassReg);
 	anInstruction3;
 	/* begin JumpLong: */
-	jumpTarget = cPICMissTrampolineFor(numArgs);
-	genoperand(JumpLong, jumpTarget);
+	jumpTarget2 = cPICMissTrampolineFor(numArgs);
+	genoperand(JumpLong, jumpTarget2);
 	0;
 	computeMaximumSizes();
+	cPIC = ((CogMethod *) methodZoneBase);
 	closedPICSize = (sizeof(CogMethod)) + (generateInstructionsAt(methodZoneBase + (sizeof(CogMethod))));
+	outputInstructionsAt(methodZoneBase + (sizeof(CogMethod)));
 	firstCPICCaseOffset = ((endCPICCase0->address)) - methodZoneBase;
 	cPICCaseSize = ((endCPICCase1->address)) - ((endCPICCase0->address));
 	cPICEndSize = closedPICSize - (((numPICCases - 1) * cPICCaseSize) + firstCPICCaseOffset);
 	closedPICSize = roundUpLength(closedPICSize);
 	assert(((picInterpretAbort->address)) == (((methodLabel->address)) + (picInterpretAbortOffset())));
+	assert((expectedClosedPICPrototype(cPIC)) == 0);
 }
 
 
@@ -12548,8 +12613,8 @@
 		/* Find target from jump.  Ignore jumps to the interpret and MNU calls within this PIC */
 
 		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc);
-		if ((entryPoint < (((sqInt)cPIC)))
-		 || (entryPoint > ((((sqInt)cPIC)) + ((cPIC->blockSize))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			if (((targetMethod->cmType)) != CMMethod) {
 				return 0;
@@ -12676,14 +12741,7 @@
 	return 1;
 }
 
-	/* Cogit>>#pc:isWithinMethod: */
-sqInt
-pcisWithinMethod(char *address, CogMethod *cogMethod)
-{
-	return (((((sqInt)address)) >= ((((sqInt)cogMethod)) + (sizeof(CogMethod)))) && ((((sqInt)address)) <= ((((sqInt)cogMethod)) + ((cogMethod->blockSize)))));
-}
 
-
 /*	This value is used to decide between MNU processing
 	or interpretation in the closed PIC aborts. */
 
@@ -13169,8 +13227,8 @@
 		/* Find target from jump.  Ignore jumps to the interpret and MNU calls within this PIC */
 
 		entryPoint = jumpLongTargetBeforeFollowingAddress(backEnd(), pc);
-		if ((entryPoint < (((sqInt)cPIC)))
-		 || (entryPoint > ((((sqInt)cPIC)) + ((cPIC->blockSize))))) {
+		if (!(((((usqInt)cPIC)) <= (((usqInt)entryPoint)))
+			 && (((((usqInt)cPIC)) + ((cPIC->blockSize))) >= (((usqInt)entryPoint))))) {
 			targetMethod = ((CogMethod *) (entryPoint - cmNoCheckEntryOffset));
 			assert(((targetMethod->cmType)) == CMMethod);
 			/* begin cPICCase:relocateJumpLongBefore:by: */

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2015-06-20 03:36:45 UTC (rev 3384)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
    from
-	CoInterpreter VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	CoInterpreter VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -614,7 +614,6 @@
 static sqInt pageListIsWellFormed(void);
 static StackPage * stackPageAt(sqInt index) NoDbgRegParms;
 static StackPage * stackPageFor(void *pointer) NoDbgRegParms;
-static unsigned long asUnsigned(sqInt anInteger) NoDbgRegParms;
 extern char * cStringOrNullFor(sqInt oop);
 extern sqInt failed(void);
 static sqInt isNegativeIntegerValueOf(sqInt oop) NoDbgRegParms;
@@ -1188,7 +1187,7 @@
 static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms;
 extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
 extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-extern usqInt stringForCString(const char *aCString);
+extern sqInt stringForCString(const char *aCString);
 static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
 static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
 extern void tenuringIncrementalGC(void);
@@ -1485,7 +1484,7 @@
 static sqInt stackPageByteSize(void);
 static sqInt stackPointerForMaybeMarriedContext(sqInt aContext) NoDbgRegParms;
 static sqInt stackPointerIndexForFrame(char *theFP) NoDbgRegParms;
-extern unsigned long stackPositiveMachineIntegerValue(sqInt offset);
+extern usqInt stackPositiveMachineIntegerValue(sqInt offset);
 extern long stackSignedMachineIntegerValue(sqInt offset);
 extern sqInt stackTop(void);
 extern sqInt stackValue(sqInt offset);
@@ -2377,7 +2376,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.oscog-eem.1359";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1367";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -18114,7 +18113,7 @@
 static sqInt
 checkForAndFollowForwardedPrimitiveState(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    signed char accessorDepth;
+    sqInt accessorDepth;
     sqInt firstBytecode;
     sqInt found;
     sqInt found1;
@@ -29612,14 +29611,7 @@
 	return stackPageAtpages(index, GIV(pages));
 }
 
-	/* InterpreterPrimitives>>#asUnsigned: */
-static unsigned long
-asUnsigned(sqInt anInteger)
-{
-	return ((unsigned long)anInteger);
-}
 
-
 /*	Answer either a malloced string with the null-terminated contents of oop
 	if oop is a string,
 	or the null pointer if oop is nil, or fail. It is the client's
@@ -32055,7 +32047,7 @@
     usqInt newObj;
     usqInt numBytes;
     sqInt numSlots;
-    usqInt s;
+    sqInt s;
     char *sp;
     sqInt sz;
 
@@ -32104,7 +32096,7 @@
 				GIV(needGCFlag) = 1;
 				forceInterruptCheck();
 			}
-			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+			s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex)));
 			goto l1;
 		}
 		if (numSlots >= 0xFF) {
@@ -45979,7 +45971,7 @@
     sqInt ptr2;
     sqInt slotBytes;
     usqInt smallObj;
-    usqInt start;
+    sqInt start;
 
 	classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
 	if (classIndex == 0) {
@@ -60240,7 +60232,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -64053,7 +64045,7 @@
 	or nil if out of memory. */
 
 	/* SpurMemoryManager>>#stringForCString: */
-usqInt
+sqInt
 stringForCString(const char *aCString)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt formatField;
@@ -65010,7 +65002,7 @@
     sqInt largeChild;
     sqInt newEndOfMemory;
     sqInt next;
-    sqInt node;
+    usqInt node;
     SpurSegmentInfo *seg;
     sqInt smallChild;
     sqInt treeNode;
@@ -65114,7 +65106,7 @@
 static sqInt
 readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt bridge;
+    usqInt bridge;
     usqInt bridgehead;
     usqInt bridgeSpan;
     sqInt bytesRead;
@@ -65330,7 +65322,7 @@
     usqLong firstSavedBridgeWord;
     sqInt nWritten;
     usqInt pier1;
-    usqInt pier2;
+    sqInt pier2;
     usqLong secondSavedBridgeWord;
 
 	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
@@ -76516,7 +76508,7 @@
 /*	In the StackInterpreter stacks grow down. */
 
 	/* StackInterpreter>>#stackPositiveMachineIntegerValue: */
-unsigned long
+usqInt
 stackPositiveMachineIntegerValue(sqInt offset)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt bs;
@@ -76535,16 +76527,16 @@
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
 			}
-			return null;
+			return ((unsigned long) null);
 		}
-		return value;
+		return ((unsigned long) value);
 	}
 	if ((integerPointer & 3) != 0) {
 		/* begin primitiveFail */
 		if (!GIV(primFailCode)) {
 			GIV(primFailCode) = 1;
 		}
-		return 0;
+		return ((unsigned long) 0);
 	}
 	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
 	assert(!(isImmediate(integerPointer)));
@@ -76558,7 +76550,7 @@
 		if (!GIV(primFailCode)) {
 			GIV(primFailCode) = 1;
 		}
-		return 0;
+		return ((unsigned long) 0);
 	}
 	/* begin numBytesOfBytes: */
 	fmt = (((usqInt) (longAt(integerPointer))) >> 24) & 0x1F;
@@ -76569,26 +76561,26 @@
 		if (!GIV(primFailCode)) {
 			GIV(primFailCode) = 1;
 		}
-		return 0;
+		return ((unsigned long) 0);
 	}
 	if (((sizeof(unsigned long)) == 8)
 	 && (bs > 4)) {
-		return 
-#    if VMBIGENDIAN
-			(((((((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)) + ((byteAt((integerPointer + BaseHeaderSize) + 4)) << 32)) + ((byteAt((integerPointer + BaseHeaderSize) + 5)) << 40)) + ((byteAt((integerPointer + BaseHeaderSize) + 6)) << 48)) + ((byteAt((integerPointer + BaseHeaderSize) + 7)) << 56)
-#    else /* VMBIGENDIAN */
-			long64At((integerPointer + BaseHeaderSize) + (0 << 3))
-#    endif /* VMBIGENDIAN */
-			;
+		return ((unsigned long) (
+#if VMBIGENDIAN
+	(((((((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)) + ((byteAt((integerPointer + BaseHeaderSize) + 4)) << 32)) + ((byteAt((integerPointer + BaseHeaderSize) + 5)) << 40)) + ((byteAt((integerPointer + BaseHeaderSize) + 6)) << 48)) + ((byteAt((integerPointer + BaseHeaderSize) + 7)) << 56)
+#else /* VMBIGENDIAN */
+	long64At((integerPointer + BaseHeaderSize) + (0 << 3))
+#endif /* VMBIGENDIAN */
+	));
 	}
 	else {
-		return 
-#    if VMBIGENDIAN
-			(((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)
-#    else /* VMBIGENDIAN */
-			long32At((integerPointer + BaseHeaderSize) + (0 << 2))
-#    endif /* VMBIGENDIAN */
-			;
+		return ((unsigned long) (
+#if VMBIGENDIAN
+	(((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)
+#else /* VMBIGENDIAN */
+	long32At((integerPointer + BaseHeaderSize) + (0 << 2))
+#endif /* VMBIGENDIAN */
+	));
 	}
 }
 
@@ -80588,7 +80580,7 @@
 		numSlots = (numSlots1 == 0xFF
 			? longAt(rcvr - BaseHeaderSize)
 			: numSlots1);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			if (((longAt(rcvr)) & 0x3FFFFF) == ClassMethodContextCompactIndex) {
 				/* begin externalWriteBackHeadFramePointers */
 				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
@@ -80603,7 +80595,7 @@
 				(GIV(stackPage)->headSP = GIV(stackPointer));
 				assert(pageListIsWellFormed());
 				numLiveSlots = (stackPointerForMaybeMarriedContext(rcvr)) + CtxtTempFrameStart;
-				if ((asUnsigned(index)) < numLiveSlots) {
+				if ((((unsigned long)index)) < numLiveSlots) {
 					value = externalInstVarofContext(index, rcvr);
 				}
 				else {
@@ -80630,7 +80622,7 @@
 		fmt1 = (((usqInt) (longAt(rcvr))) >> 24) & 0x1F;
 		assert(fmt1 >= (firstByteFormat()));
 		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPushInteger: */
 			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((byteAt((rcvr + BaseHeaderSize) + index)) << 1) | 1));
 			GIV(stackPointer) = sp1;
@@ -80641,7 +80633,7 @@
 	}
 	if (fmt >= 12) {
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPushInteger: */
 			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((shortAt((rcvr + BaseHeaderSize) + (index << 1))) << 1) | 1));
 			GIV(stackPointer) = sp2;
@@ -80652,7 +80644,7 @@
 	}
 	if (fmt == 9) {
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPush: */
 			oop = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (index << 3)));
 			longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
@@ -80664,7 +80656,7 @@
 	}
 	if (fmt >= 10) {
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPush: */
 			/* begin positive32BitIntegerFor: */
 			integerValue = long32At((rcvr + BaseHeaderSize) + (index << 2));
@@ -80784,7 +80776,7 @@
 		numSlots = (numSlots1 == 0xFF
 			? longAt(rcvr - BaseHeaderSize)
 			: numSlots1);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			if (((longAt(rcvr)) & 0x3FFFFF) == ClassMethodContextCompactIndex) {
 				externalInstVarofContextput(index, rcvr, newValue);
 			}
@@ -80893,7 +80885,7 @@
 			(GIV(primFailCode) = PrimErrUnsupported);
 			return;
 		}
-		if ((asUnsigned(value)) > 0xFF) {
+		if ((((unsigned long)value)) > 0xFF) {
 			(GIV(primFailCode) = PrimErrBadArgument);
 			return;
 		}
@@ -80901,7 +80893,7 @@
 		fmt1 = (((usqInt) (longAt(rcvr))) >> 24) & 0x1F;
 		assert(fmt1 >= (firstByteFormat()));
 		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			byteAtput((rcvr + BaseHeaderSize) + index, value);
 			/* begin pop:thenPush: */
 			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
@@ -80912,12 +80904,12 @@
 		return;
 	}
 	if (fmt >= 12) {
-		if ((asUnsigned(value)) > 0xFFFF) {
+		if ((((unsigned long)value)) > 0xFFFF) {
 			(GIV(primFailCode) = PrimErrBadArgument);
 			return;
 		}
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			shortAtput((rcvr + BaseHeaderSize) + (index << 1), value);
 			/* begin pop:thenPush: */
 			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
@@ -80931,7 +80923,7 @@
 	if (fmt >= 10) {
 		;
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			long32Atput((rcvr + BaseHeaderSize) + (index << 2), value);
 			/* begin pop:thenPush: */
 			longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2015-06-20 03:36:45 UTC (rev 3384)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
  */
 
 
@@ -258,7 +258,7 @@
 extern sqInt splObj(sqInt index);
 extern usqInt storeCheckBoundary(void);
 extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-extern usqInt stringForCString(const char *aCString);
+extern sqInt stringForCString(const char *aCString);
 extern void tenuringIncrementalGC(void);
 extern sqInt topRemappableOop(void);
 extern sqInt validFreeTree(void);
@@ -315,7 +315,7 @@
 extern sqInt sizeOfCallPrimitiveBytecode(sqInt methodHeader);
 extern sqInt sizeOfLongStoreTempBytecode(sqInt methodHeader);
 extern sqInt specialSelector(sqInt index);
-extern unsigned long stackPositiveMachineIntegerValue(sqInt offset);
+extern usqInt stackPositiveMachineIntegerValue(sqInt offset);
 extern long stackSignedMachineIntegerValue(sqInt offset);
 extern sqInt stackTop(void);
 extern sqInt stackValue(sqInt offset);

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2015-06-20 03:36:45 UTC (rev 3384)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
    from
-	CoInterpreter VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	CoInterpreter VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -617,7 +617,6 @@
 static sqInt pageListIsWellFormed(void);
 static StackPage * stackPageAt(sqInt index) NoDbgRegParms;
 static StackPage * stackPageFor(void *pointer) NoDbgRegParms;
-static unsigned long asUnsigned(sqInt anInteger) NoDbgRegParms;
 extern char * cStringOrNullFor(sqInt oop);
 extern sqInt failed(void);
 static sqInt isNegativeIntegerValueOf(sqInt oop) NoDbgRegParms;
@@ -1191,7 +1190,7 @@
 static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms;
 extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
 extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-extern usqInt stringForCString(const char *aCString);
+extern sqInt stringForCString(const char *aCString);
 static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
 static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
 extern void tenuringIncrementalGC(void);
@@ -1488,7 +1487,7 @@
 static sqInt stackPageByteSize(void);
 static sqInt stackPointerForMaybeMarriedContext(sqInt aContext) NoDbgRegParms;
 static sqInt stackPointerIndexForFrame(char *theFP) NoDbgRegParms;
-extern unsigned long stackPositiveMachineIntegerValue(sqInt offset);
+extern usqInt stackPositiveMachineIntegerValue(sqInt offset);
 extern long stackSignedMachineIntegerValue(sqInt offset);
 extern sqInt stackTop(void);
 extern sqInt stackValue(sqInt offset);
@@ -2380,7 +2379,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.oscog-eem.1359";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1367";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -18123,7 +18122,7 @@
 static sqInt
 checkForAndFollowForwardedPrimitiveState(void)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    signed char accessorDepth;
+    sqInt accessorDepth;
     sqInt firstBytecode;
     sqInt found;
     sqInt found1;
@@ -29621,14 +29620,7 @@
 	return stackPageAtpages(index, GIV(pages));
 }
 
-	/* InterpreterPrimitives>>#asUnsigned: */
-static unsigned long
-asUnsigned(sqInt anInteger)
-{
-	return ((unsigned long)anInteger);
-}
 
-
 /*	Answer either a malloced string with the null-terminated contents of oop
 	if oop is a string,
 	or the null pointer if oop is nil, or fail. It is the client's
@@ -32064,7 +32056,7 @@
     usqInt newObj;
     usqInt numBytes;
     sqInt numSlots;
-    usqInt s;
+    sqInt s;
     char *sp;
     sqInt sz;
 
@@ -32113,7 +32105,7 @@
 				GIV(needGCFlag) = 1;
 				forceInterruptCheck();
 			}
-			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+			s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex)));
 			goto l1;
 		}
 		if (numSlots >= 0xFF) {
@@ -45988,7 +45980,7 @@
     sqInt ptr2;
     sqInt slotBytes;
     usqInt smallObj;
-    usqInt start;
+    sqInt start;
 
 	classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
 	if (classIndex == 0) {
@@ -60249,7 +60241,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -64062,7 +64054,7 @@
 	or nil if out of memory. */
 
 	/* SpurMemoryManager>>#stringForCString: */
-usqInt
+sqInt
 stringForCString(const char *aCString)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt formatField;
@@ -65019,7 +65011,7 @@
     sqInt largeChild;
     sqInt newEndOfMemory;
     sqInt next;
-    sqInt node;
+    usqInt node;
     SpurSegmentInfo *seg;
     sqInt smallChild;
     sqInt treeNode;
@@ -65123,7 +65115,7 @@
 static sqInt
 readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt bridge;
+    usqInt bridge;
     usqInt bridgehead;
     usqInt bridgeSpan;
     sqInt bytesRead;
@@ -65339,7 +65331,7 @@
     usqLong firstSavedBridgeWord;
     sqInt nWritten;
     usqInt pier1;
-    usqInt pier2;
+    sqInt pier2;
     usqLong secondSavedBridgeWord;
 
 	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
@@ -76525,7 +76517,7 @@
 /*	In the StackInterpreter stacks grow down. */
 
 	/* StackInterpreter>>#stackPositiveMachineIntegerValue: */
-unsigned long
+usqInt
 stackPositiveMachineIntegerValue(sqInt offset)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt bs;
@@ -76544,16 +76536,16 @@
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
 			}
-			return null;
+			return ((unsigned long) null);
 		}
-		return value;
+		return ((unsigned long) value);
 	}
 	if ((integerPointer & 3) != 0) {
 		/* begin primitiveFail */
 		if (!GIV(primFailCode)) {
 			GIV(primFailCode) = 1;
 		}
-		return 0;
+		return ((unsigned long) 0);
 	}
 	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
 	assert(!(isImmediate(integerPointer)));
@@ -76567,7 +76559,7 @@
 		if (!GIV(primFailCode)) {
 			GIV(primFailCode) = 1;
 		}
-		return 0;
+		return ((unsigned long) 0);
 	}
 	/* begin numBytesOfBytes: */
 	fmt = (((usqInt) (longAt(integerPointer))) >> 24) & 0x1F;
@@ -76578,26 +76570,26 @@
 		if (!GIV(primFailCode)) {
 			GIV(primFailCode) = 1;
 		}
-		return 0;
+		return ((unsigned long) 0);
 	}
 	if (((sizeof(unsigned long)) == 8)
 	 && (bs > 4)) {
-		return 
-#    if VMBIGENDIAN
-			(((((((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)) + ((byteAt((integerPointer + BaseHeaderSize) + 4)) << 32)) + ((byteAt((integerPointer + BaseHeaderSize) + 5)) << 40)) + ((byteAt((integerPointer + BaseHeaderSize) + 6)) << 48)) + ((byteAt((integerPointer + BaseHeaderSize) + 7)) << 56)
-#    else /* VMBIGENDIAN */
-			long64At((integerPointer + BaseHeaderSize) + (0 << 3))
-#    endif /* VMBIGENDIAN */
-			;
+		return ((unsigned long) (
+#if VMBIGENDIAN
+	(((((((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)) + ((byteAt((integerPointer + BaseHeaderSize) + 4)) << 32)) + ((byteAt((integerPointer + BaseHeaderSize) + 5)) << 40)) + ((byteAt((integerPointer + BaseHeaderSize) + 6)) << 48)) + ((byteAt((integerPointer + BaseHeaderSize) + 7)) << 56)
+#else /* VMBIGENDIAN */
+	long64At((integerPointer + BaseHeaderSize) + (0 << 3))
+#endif /* VMBIGENDIAN */
+	));
 	}
 	else {
-		return 
-#    if VMBIGENDIAN
-			(((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)
-#    else /* VMBIGENDIAN */
-			long32At((integerPointer + BaseHeaderSize) + (0 << 2))
-#    endif /* VMBIGENDIAN */
-			;
+		return ((unsigned long) (
+#if VMBIGENDIAN
+	(((byteAt((integerPointer + BaseHeaderSize))) + ((byteAt((integerPointer + BaseHeaderSize) + 1)) << 8)) + ((byteAt((integerPointer + BaseHeaderSize) + 2)) << 16)) + ((byteAt((integerPointer + BaseHeaderSize) + 3)) << 24)
+#else /* VMBIGENDIAN */
+	long32At((integerPointer + BaseHeaderSize) + (0 << 2))
+#endif /* VMBIGENDIAN */
+	));
 	}
 }
 
@@ -80597,7 +80589,7 @@
 		numSlots = (numSlots1 == 0xFF
 			? longAt(rcvr - BaseHeaderSize)
 			: numSlots1);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			if (((longAt(rcvr)) & 0x3FFFFF) == ClassMethodContextCompactIndex) {
 				/* begin externalWriteBackHeadFramePointers */
 				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
@@ -80612,7 +80604,7 @@
 				(GIV(stackPage)->headSP = GIV(stackPointer));
 				assert(pageListIsWellFormed());
 				numLiveSlots = (stackPointerForMaybeMarriedContext(rcvr)) + CtxtTempFrameStart;
-				if ((asUnsigned(index)) < numLiveSlots) {
+				if ((((unsigned long)index)) < numLiveSlots) {
 					value = externalInstVarofContext(index, rcvr);
 				}
 				else {
@@ -80639,7 +80631,7 @@
 		fmt1 = (((usqInt) (longAt(rcvr))) >> 24) & 0x1F;
 		assert(fmt1 >= (firstByteFormat()));
 		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPushInteger: */
 			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((byteAt((rcvr + BaseHeaderSize) + index)) << 1) | 1));
 			GIV(stackPointer) = sp1;
@@ -80650,7 +80642,7 @@
 	}
 	if (fmt >= 12) {
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPushInteger: */
 			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((shortAt((rcvr + BaseHeaderSize) + (index << 1))) << 1) | 1));
 			GIV(stackPointer) = sp2;
@@ -80661,7 +80653,7 @@
 	}
 	if (fmt == 9) {
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPush: */
 			oop = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (index << 3)));
 			longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
@@ -80673,7 +80665,7 @@
 	}
 	if (fmt >= 10) {
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			/* begin pop:thenPush: */
 			/* begin positive32BitIntegerFor: */
 			integerValue = long32At((rcvr + BaseHeaderSize) + (index << 2));
@@ -80793,7 +80785,7 @@
 		numSlots = (numSlots1 == 0xFF
 			? longAt(rcvr - BaseHeaderSize)
 			: numSlots1);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			if (((longAt(rcvr)) & 0x3FFFFF) == ClassMethodContextCompactIndex) {
 				externalInstVarofContextput(index, rcvr, newValue);
 			}
@@ -80902,7 +80894,7 @@
 			(GIV(primFailCode) = PrimErrUnsupported);
 			return;
 		}
-		if ((asUnsigned(value)) > 0xFF) {
+		if ((((unsigned long)value)) > 0xFF) {
 			(GIV(primFailCode) = PrimErrBadArgument);
 			return;
 		}
@@ -80910,7 +80902,7 @@
 		fmt1 = (((usqInt) (longAt(rcvr))) >> 24) & 0x1F;
 		assert(fmt1 >= (firstByteFormat()));
 		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			byteAtput((rcvr + BaseHeaderSize) + index, value);
 			/* begin pop:thenPush: */
 			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
@@ -80921,12 +80913,12 @@
 		return;
 	}
 	if (fmt >= 12) {
-		if ((asUnsigned(value)) > 0xFFFF) {
+		if ((((unsigned long)value)) > 0xFFFF) {
 			(GIV(primFailCode) = PrimErrBadArgument);
 			return;
 		}
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			shortAtput((rcvr + BaseHeaderSize) + (index << 1), value);
 			/* begin pop:thenPush: */
 			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
@@ -80940,7 +80932,7 @@
 	if (fmt >= 10) {
 		;
 		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
-		if ((asUnsigned(index)) < numSlots) {
+		if ((((unsigned long)index)) < numSlots) {
 			long32Atput((rcvr + BaseHeaderSize) + (index << 2), value);
 			/* begin pop:thenPush: */
 			longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Fri Jun 19 11:12:50 PDT 2015
   + Fri Jun 19 20:35:58 PDT 2015

Modified: branches/Cog/spursistasrc/vm/cogit.h
===================================================================
--- branches/Cog/spursistasrc/vm/cogit.h	2015-06-19 18:13:41 UTC (rev 3383)
+++ branches/Cog/spursistasrc/vm/cogit.h	2015-06-20 03:36:45 UTC (rev 3384)
@@ -1,5 +1,5 @@
 /* Automatically generated by

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list