[Vm-dev] [commit][2872] CogVM source as per VMMaker.oscog-eem.630

commits at squeakvm.org commits at squeakvm.org
Thu Mar 6 20:51:02 UTC 2014


Revision: 2872
Author:   eliot
Date:     2014-03-06 12:51:00 -0800 (Thu, 06 Mar 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.630

Revamp primitiveVMParameter to avoid overflow in values such as total heap size.
Make statProcessSwitch, statIOProcessEvents, statForceInterruptCheck,
statCheckForEvents, statStackOverflow & statStackPageDivorce 64-bit to avoid
wrapping.  Make sure that positive64BitIntegerFor: will not cause a GC just as
positive32BitIntegerFor: doesn't.

Fix startPCOrNilOfLiteral:in: (for scanForCleanBlocks) for newspeak
accessors in Spur.

Add eeInstantiateSmallClassIndex:format:numSlots: for afap
allocation of small objects.

Fix slip in objCouldBeClassObj:; objectMemory rawHashBitsOf: objOop should read
objectMemory rawHashBitsOf: fieldOop.

Use neater expression for determining Spur size of large free chunk
and add an assert to freeTreeNodesDo: to try and track down
appearance of small chunk in free chunk tree.

Modified Paths:
--------------
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nscogsrc/vm/interp.h
    branches/Cog/nscogsrc/vm/vmCallback.h
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspursrc/vm/interp.h
    branches/Cog/nsspursrc/vm/vmCallback.h
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/nsspurstacksrc/vm/interp.h
    branches/Cog/nsspurstacksrc/vm/vmCallback.h
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/interp.h
    branches/Cog/spursrc/vm/vmCallback.h
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/spurstacksrc/vm/interp.h
    branches/Cog/spurstacksrc/vm/vmCallback.h
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/src/vm/interp.h
    branches/Cog/src/vm/vmCallback.h
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c
    branches/Cog/stacksrc/vm/interp.h
    branches/Cog/stacksrc/vm/vmCallback.h

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

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-03-01 15:54:53 UTC (rev 2871)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-03-06 20:51:00 UTC (rev 2872)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
    from
-	CoInterpreter VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CoInterpreter VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -515,6 +515,7 @@
 sqInt eeInstantiateClassIndexformatnumSlots(sqInt compactClassIndex, sqInt objFormat, sqInt numSlots);
 sqInt eeInstantiateClassindexableSize(sqInt classPointer, sqInt size);
 static sqInt eeInstantiateMethodContextSlots(sqInt numSlots);
+static sqInt eeInstantiateSmallClassIndexformatnumSlots(sqInt compactClassIndex, sqInt objFormat, sqInt numSlots);
 static sqInt eeInstantiateSmallClassnumSlots(sqInt classPointer, sqInt numSlots);
 static sqInt ensureCallerContext(char *theFP);
 static void ensureContextIsExecutionSafeAfterAssignToStackPointer(sqInt aContext);
@@ -1272,9 +1273,9 @@
 _iss usqInt method;
 _iss StackPage * stackPage;
 _iss sqInt bytecodeSetSelector;
+_iss usqInt freeStart;
 _iss usqInt instructionPointer;
 _iss sqInt argumentCount;
-_iss usqInt freeStart;
 _iss sqInt nilObj;
 _iss usqInt newMethod;
 _iss sqInt messageSelector;
@@ -1293,11 +1294,11 @@
 _iss usqInt memoryLimit;
 _iss StackPage * mostRecentlyUsedPage;
 _iss unsigned char primTraceLogIndex;
+_iss usqInt scavengeThreshold;
 _iss sqInt numStackPages;
-_iss usqInt scavengeThreshold;
+_iss sqInt needGCFlag;
 _iss sqInt jmpDepth;
 _iss sqLong nextProfileTick;
-_iss sqInt needGCFlag;
 _iss usqInt fwdTableNext;
 _iss sqInt longRunningPrimitiveCheckSemaphore;
 _iss sqInt tempOop;
@@ -1320,7 +1321,7 @@
 _iss sqInt highestRunnableProcessPriority;
 _iss usqLong longRunningPrimitiveStartUsecs;
 _iss usqLong longRunningPrimitiveStopUsecs;
-_iss sqInt statCheckForEvents;
+_iss usqLong statCheckForEvents;
 _iss sqInt statGrowMemory;
 _iss sqInt statMarkCount;
 _iss sqInt lastCoggableInterpretedBlockMethod;
@@ -1335,7 +1336,7 @@
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
 _iss sqInt pendingFinalizationSignals;
-_iss sqInt statIOProcessEvents;
+_iss usqLong statIOProcessEvents;
 _iss sqInt edenBytes;
 _iss usqInt fwdTableLast;
 _iss usqLong gcStartUsecs;
@@ -1354,18 +1355,18 @@
 _iss sqInt methodDictLinearSearchLimit;
 _iss usqLong nextPollUsecs;
 _iss sqInt signalLowSpace;
-_iss sqInt statForceInterruptCheck;
+_iss usqLong statForceInterruptCheck;
 _iss usqLong statFullGCUsecs;
 _iss sqInt statFullGCs;
 _iss usqLong statIncrGCUsecs;
 _iss sqInt statIncrGCs;
 _iss sqInt statPendingFinalizationSignals;
-_iss sqInt statProcessSwitch;
+_iss usqLong statProcessSwitch;
 _iss sqInt statRootTableOverflows;
 _iss sqInt statShrinkMemory;
 _iss sqInt statSpecialMarkCount;
-_iss sqInt statStackOverflow;
-_iss sqInt statStackPageDivorce;
+_iss usqLong statStackOverflow;
+_iss usqLong statStackPageDivorce;
 _iss sqInt statTenures;
 _iss sqInt totalObjectCount;
 _iss sqInt extraFramesToMoveOnOverflow;
@@ -2032,7 +2033,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.624";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.630";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5922,11 +5923,7 @@
 				GIV(stackPointer) = localSP;
 				GIV(framePointer) = localFP;
 				array = eeInstantiateClassIndexformatnumSlots(ClassArrayCompactIndex, 2, size);
-				/* begin internalizeIPandSP */
-				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
-				localIP = pointerForOop(GIV(instructionPointer));
-				localSP = pointerForOop(GIV(stackPointer));
-				localFP = pointerForOop(GIV(framePointer));
+
 				if (popValues) {
 					for (i = 0; i < size; i += 1) {
 
@@ -18379,8 +18376,8 @@
 
 	assert((isImmediate(GIV(messageSelector)))
 	 || (addressCouldBeObj(GIV(messageSelector))));
-	argumentArray = eeInstantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << ShiftForWord)), GIV(argumentCount));
-	message = eeInstantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMessage << ShiftForWord)), 0);
+	argumentArray = eeInstantiateSmallClassnumSlots(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << ShiftForWord)), GIV(argumentCount));
+	message = eeInstantiateSmallClassnumSlots(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMessage << ShiftForWord)), MessageLookupClassIndex + 1);
 
 	for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) {
 		longAtput((argumentArray + (BaseHeaderSize)) + i, popStack());
@@ -19657,8 +19654,85 @@
 	Since this call is used in routines that do just that we are safe. Break
 	this rule and die in GC.
 	Will *not* cause a GC. Result is guaranteed to be young. */
+/*	cannot have a negative indexable field count */
 
 static sqInt
+eeInstantiateSmallClassIndexformatnumSlots(sqInt compactClassIndex, sqInt objFormat, sqInt numSlots)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hash;
+    sqInt header1;
+    usqInt newChunk;
+    usqInt newFreeStart;
+    sqInt newObj;
+    sqInt sizeInBytes;
+
+	assert((numSlots >= 0)
+	 && (compactClassIndex != 0));
+	assert(((objFormat < (firstByteFormat())
+	? objFormat
+	: objFormat & (byteFormatMask()))) == (instSpecOfClass(compactClassAt(compactClassIndex))));
+	sizeInBytes = (numSlots << ShiftForWord) + BaseHeaderSize;
+	assert(sizeInBytes <= 0xFC);
+	hash = ((usqInt) GIV(freeStart)) >> ShiftForWord;
+	header1 = ((objFormat << (instFormatFieldLSB())) | (compactClassIndex << 12)) | ((hash & HashMaskUnshifted) << HashBitsOffset);
+	header1 += sizeInBytes - (header1 & (SizeMask + Size4Bit));
+	/* begin eeAllocate:headerSize:h1:h2:h3: */
+	/* begin allocateInterpreterChunk: */
+	newChunk = GIV(freeStart);
+	newFreeStart = GIV(freeStart) + (sizeInBytes + ((1 - 1) * BytesPerWord));
+	if (newFreeStart < GIV(scavengeThreshold)) {
+		if ((AllocationCheckFiller != 0)
+		 && ((longAt(newChunk)) != (newChunk))) {
+			error("last object overwritten");
+		}
+		GIV(freeStart) = newFreeStart;
+		newObj = oopForPointer(newChunk);
+		goto l1;
+	}
+	if (GIV(freeStart) < GIV(scavengeThreshold)) {
+		/* begin scheduleIncrementalGC */
+		GIV(needGCFlag) = 1;
+		forceInterruptCheck();
+	}
+	if (newFreeStart < GIV(reserveStart)) {
+		GIV(freeStart) = newFreeStart;
+		newObj = oopForPointer(newChunk);
+		goto l1;
+	}
+	/* begin scheduleIncrementalGC */
+	GIV(needGCFlag) = 1;
+	forceInterruptCheck();
+	if (GIV(freeStart) <= GIV(endOfMemory)) {
+		GIV(freeStart) = newFreeStart;
+		newObj = oopForPointer(newChunk);
+		goto l1;
+	}
+	error("out of memory");
+	newObj = null;
+l1:	/* end allocateInterpreterChunk: */;
+	if (newObj == 0) {
+		return newObj;
+	}
+	
+	
+	longAtput(newObj, header1 | HeaderTypeShort);
+
+	
+	return newObj;
+}
+
+
+/*	This version of instantiateClass assumes that the total object size is
+	under 256 bytes, the limit for objects with only one or two header words. 
+	NOTE this code will only work for sizes that are an integral number of
+	words (hence not a 32-bit LargeInteger in a 64-bit system).
+	Note that the created small object IS NOT FILLED and must be completed
+	before returning it to Squeak.
+	Since this call is used in routines that do just that we are safe. Break
+	this rule and die in GC.
+	Will *not* cause a GC. Result is guaranteed to be young. */
+
+static sqInt
 eeInstantiateSmallClassnumSlots(sqInt classPointer, sqInt numSlots)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt hash;
@@ -21923,7 +21997,7 @@
 {
     sqInt newFloatObj;
 
-	newFloatObj = eeInstantiateClassIndexformatnumSlots(ClassFloatCompactIndex, 6, ((sqInt) 8 >> 2));
+	newFloatObj = eeInstantiateSmallClassIndexformatnumSlots(ClassFloatCompactIndex, 6, ((sqInt) 8 >> 2));
 	storeFloatAtfrom(newFloatObj + (BaseHeaderSize), aFloat);
 	return newFloatObj;
 }
@@ -29196,19 +29270,19 @@
     sqInt fieldOop;
 
 	return (((((usqInt) (longAt(objOop))) >> (instFormatFieldLSB())) & 15) <= 4)
-	 && (((numSlotsOf(objOop)) >= (InstanceSpecificationIndex + 1))
+	 && (((numSlotsOf(objOop)) > InstanceSpecificationIndex)
 	 && (((fieldOop = longAt((objOop + BaseHeaderSize) + (SuperclassIndex << ShiftForWord))),
-	((((fieldOop & 1) == 0)
- && (((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4))
- || ((((((usqInt) (longAt(objOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
+	(((fieldOop & 1) == 0)
+ && ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
+ || ((((((usqInt) (longAt(fieldOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
  && (0
- && (isPointers(followForwarded(fieldOop))))))
+ && (isPointers(followForwarded(fieldOop)))))))
 		 && (((fieldOop = longAt((objOop + BaseHeaderSize) + (MethodDictionaryIndex << ShiftForWord))),
-		((((fieldOop & 1) == 0)
- && (((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4))
- || ((((((usqInt) (longAt(objOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
+		(((fieldOop & 1) == 0)
+ && ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
+ || ((((((usqInt) (longAt(fieldOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
  && (0
- && (isPointers(followForwarded(fieldOop))))))
+ && (isPointers(followForwarded(fieldOop)))))))
 			 && (((longAt((objOop + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) & 1)))))));
 }
 
@@ -29700,9 +29774,8 @@
 }
 
 
-/*	Note - integerValue is interpreted as POSITIVE, eg, as the result of
-	Bitmap>at:, or integer>bitAnd:.
- */
+/*	N.B. will *not* cause a GC.
+	integerValue is interpreted as POSITIVE, e.g. as the result of Bitmap>at:. */
 
 sqInt
 positive32BitIntegerFor(sqInt integerValue)
@@ -29713,7 +29786,7 @@
 	 && ((integerValue ^ (integerValue << 1)) >= 0)) {
 		return ((integerValue << 1) | 1);
 	}
-	newLargeInteger = eeInstantiateClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + (4 & 3), 1);
+	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + (4 & 3), 1);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 3, (((usqInt) integerValue) >> 24) & 0xFF);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 2, (((usqInt) integerValue) >> 16) & 0xFF);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 1, (((usqInt) integerValue) >> 8) & 0xFF);
@@ -29772,21 +29845,16 @@
 }
 
 
-/*	Note - integerValue is interpreted as POSITIVE, eg, as the result of
-	Bitmap>at:, or integer>bitAnd:. */
+/*	N.B. will *not* cause a GC.
+	integerValue is interpreted as POSITIVE, e.g. as the result of Bitmap>at:. */
 
 sqInt
 positive64BitIntegerFor(sqLong integerValue)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+{
     sqInt highWord;
-    sqInt i;
     sqInt newLargeInteger;
     sqInt sz;
-    sqInt value;
 
-	if ((sizeof(integerValue)) == 4) {
-		return positive32BitIntegerFor(integerValue);
-	}
 
 	/* shift is coerced to usqInt otherwise */
 
@@ -29804,11 +29872,15 @@
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
 	}
-	newLargeInteger = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << ShiftForWord)), sz);
-	for (i = 0; i < sz; i += 1) {
-		value = (integerValue >> (i * 8)) & 255;
-		byteAtput((newLargeInteger + BaseHeaderSize) + i, value);
-	}
+	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + (sz & 3), ((sqInt) 8 >> 2));
+	byteAtput((newLargeInteger + BaseHeaderSize) + 7, (((unsigned sqLong)integerValue) >> 56) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 6, (((unsigned sqLong)integerValue) >> 48) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 5, (((unsigned sqLong)integerValue) >> 40) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 4, (((unsigned sqLong)integerValue) >> 32) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 3, (((unsigned sqLong)integerValue) >> 24) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 2, (((unsigned sqLong)integerValue) >> 16) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 1, (((unsigned sqLong)integerValue) >> 8) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 0, integerValue & 0xFF);
 	return newLargeInteger;
 }
 
@@ -44847,7 +44919,13 @@
     sqInt valuePointer15;
     sqInt valuePointer16;
     sqInt valuePointer17;
+    sqInt valuePointer18;
+    sqInt valuePointer19;
     sqInt valuePointer2;
+    sqInt valuePointer20;
+    sqInt valuePointer21;
+    sqInt valuePointer22;
+    sqInt valuePointer23;
     sqInt valuePointer3;
     sqInt valuePointer4;
     sqInt valuePointer5;
@@ -44863,10 +44941,10 @@
 		valuePointer = (((GIV(freeStart) - (startOfMemory())) << 1) | 1);
 		longAtput((result + BaseHeaderSize) + (0 << ShiftForWord), valuePointer);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer1 = (((GIV(youngStart) - (startOfMemory())) << 1) | 1);
+		valuePointer1 = positive64BitIntegerFor(GIV(youngStart) - (startOfMemory()));
 		longAtput((result + BaseHeaderSize) + (1 << ShiftForWord), valuePointer1);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer2 = (((GIV(endOfMemory) - (startOfMemory())) << 1) | 1);
+		valuePointer2 = positive64BitIntegerFor(GIV(endOfMemory) - (startOfMemory()));
 		longAtput((result + BaseHeaderSize) + (2 << ShiftForWord), valuePointer2);
 		longAtput((result + BaseHeaderSize) + (3 << ShiftForWord), GIV(nilObj));
 		longAtput((result + BaseHeaderSize) + (4 << ShiftForWord), GIV(nilObj));
@@ -44935,27 +45013,39 @@
 		for (i = 49; i <= 54; i += 1) {
 			longAtput((result + BaseHeaderSize) + (i << ShiftForWord), GIV(nilObj));
 		}
-		longAtput((result + BaseHeaderSize) + (55 << ShiftForWord), ((GIV(statProcessSwitch) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (56 << ShiftForWord), ((GIV(statIOProcessEvents) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (57 << ShiftForWord), ((GIV(statForceInterruptCheck) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (58 << ShiftForWord), ((GIV(statCheckForEvents) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (59 << ShiftForWord), ((GIV(statStackOverflow) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (60 << ShiftForWord), ((GIV(statStackPageDivorce) << 1) | 1));
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer11 = getCodeCompactionCount();
-		longAtput((result + BaseHeaderSize) + (61 << ShiftForWord), valuePointer11);
+		valuePointer11 = positive64BitIntegerFor(GIV(statProcessSwitch));
+		longAtput((result + BaseHeaderSize) + (55 << ShiftForWord), valuePointer11);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer12 = getCodeCompactionMSecs();
-		longAtput((result + BaseHeaderSize) + (0x3E << ShiftForWord), valuePointer12);
+		valuePointer12 = positive64BitIntegerFor(GIV(statIOProcessEvents));
+		longAtput((result + BaseHeaderSize) + (56 << ShiftForWord), valuePointer12);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer13 = (((numMethodsOfType(CMMethod)) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (0x3F << ShiftForWord), valuePointer13);
+		valuePointer13 = positive64BitIntegerFor(GIV(statForceInterruptCheck));
+		longAtput((result + BaseHeaderSize) + (57 << ShiftForWord), valuePointer13);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer14 = GIV(trueObj);
-		longAtput((result + BaseHeaderSize) + (64 << ShiftForWord), valuePointer14);
+		valuePointer14 = positive64BitIntegerFor(GIV(statCheckForEvents));
+		longAtput((result + BaseHeaderSize) + (58 << ShiftForWord), valuePointer14);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer15 = (((stackPageByteSize()) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (65 << ShiftForWord), valuePointer15);
+		valuePointer15 = positive64BitIntegerFor(GIV(statStackOverflow));
+		longAtput((result + BaseHeaderSize) + (59 << ShiftForWord), valuePointer15);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer16 = positive64BitIntegerFor(GIV(statStackPageDivorce));
+		longAtput((result + BaseHeaderSize) + (60 << ShiftForWord), valuePointer16);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer17 = getCodeCompactionCount();
+		longAtput((result + BaseHeaderSize) + (61 << ShiftForWord), valuePointer17);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer18 = getCodeCompactionMSecs();
+		longAtput((result + BaseHeaderSize) + (0x3E << ShiftForWord), valuePointer18);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer19 = (((numMethodsOfType(CMMethod)) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (0x3F << ShiftForWord), valuePointer19);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer20 = GIV(trueObj);
+		longAtput((result + BaseHeaderSize) + (64 << ShiftForWord), valuePointer20);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer21 = (((stackPageByteSize()) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (65 << ShiftForWord), valuePointer21);
 		for (i = 66; i <= 68; i += 1) {
 
 			/* reserved for more Cog-related info */
@@ -44963,11 +45053,11 @@
 			longAtput((result + BaseHeaderSize) + (i << ShiftForWord), GIV(nilObj));
 		}
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer16 = (((VM_PROXY_MAJOR) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (69 << ShiftForWord), valuePointer16);
+		valuePointer22 = (((VM_PROXY_MAJOR) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (69 << ShiftForWord), valuePointer22);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer17 = (((VM_PROXY_MINOR) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (70 << ShiftForWord), valuePointer17);
+		valuePointer23 = (((VM_PROXY_MINOR) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (70 << ShiftForWord), valuePointer23);
 		assert(paramsArraySize == 71);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), result);
@@ -44994,10 +45084,10 @@
 			result = (((GIV(freeStart) - (startOfMemory())) << 1) | 1);
 		}
 		if (arg == 2) {
-			result = (((GIV(youngStart) - (startOfMemory())) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(youngStart) - (startOfMemory()));
 		}
 		if (arg == 3) {
-			result = (((GIV(endOfMemory) - (startOfMemory())) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(endOfMemory) - (startOfMemory()));
 		}
 		if (arg == 4) {
 
@@ -45131,22 +45221,22 @@
 			result = (((ioGetMaxExtSemTableSize()) << 1) | 1);
 		}
 		if (arg == 56) {
-			result = ((GIV(statProcessSwitch) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statProcessSwitch));
 		}
 		if (arg == 57) {
-			result = ((GIV(statIOProcessEvents) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statIOProcessEvents));
 		}
 		if (arg == 58) {
-			result = ((GIV(statForceInterruptCheck) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statForceInterruptCheck));
 		}
 		if (arg == 59) {
-			result = ((GIV(statCheckForEvents) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statCheckForEvents));
 		}
 		if (arg == 60) {
-			result = ((GIV(statStackOverflow) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statStackOverflow));
 		}
 		if (arg == 61) {
-			result = ((GIV(statStackPageDivorce) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statStackPageDivorce));
 		}
 		if (arg == 0x3E) {
 			result = getCodeCompactionCount();
@@ -52495,7 +52585,7 @@
 
 
 /*	Answer the startPC of lit if it is a (clean) block in aMethodObj,
-	oitherwise answer nil.
+	otherwise answer nil.
  */
 
 sqInt
@@ -52504,15 +52594,11 @@
     sqInt oop;
     sqInt outerContext;
 
-	if ((lit & 1)) {
+	if (!(((lit & 1) == 0)
+		 && ((((((usqInt) (longAt(lit))) >> (instFormatFieldLSB())) & 15) == 3)
+		 && ((numSlotsOf(lit)) >= ClosureCopiedValuesIndex)))) {
 		return null;
 	}
-	if ((lastPointerOf(lit)) <= ClosureCopiedValuesIndex) {
-		return null;
-	}
-	if (((((usqInt) (longAt(lit))) >> (instFormatFieldLSB())) & 15) == 2) {
-		return null;
-	}
 	outerContext = longAt((lit + BaseHeaderSize) + (ClosureOuterContextIndex << ShiftForWord));
 	if (!(((outerContext & 1) == 0)
 		 && (((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == ClassMethodContextCompactIndex))) {

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-03-01 15:54:53 UTC (rev 2871)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-03-06 20:51:00 UTC (rev 2872)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
  */
 
 

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-03-01 15:54:53 UTC (rev 2871)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-03-06 20:51:00 UTC (rev 2872)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
    from
-	CoInterpreter VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CoInterpreter VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -518,6 +518,7 @@
 sqInt eeInstantiateClassIndexformatnumSlots(sqInt compactClassIndex, sqInt objFormat, sqInt numSlots);
 sqInt eeInstantiateClassindexableSize(sqInt classPointer, sqInt size);
 static sqInt eeInstantiateMethodContextSlots(sqInt numSlots);
+static sqInt eeInstantiateSmallClassIndexformatnumSlots(sqInt compactClassIndex, sqInt objFormat, sqInt numSlots);
 static sqInt eeInstantiateSmallClassnumSlots(sqInt classPointer, sqInt numSlots);
 static sqInt ensureCallerContext(char *theFP);
 static void ensureContextIsExecutionSafeAfterAssignToStackPointer(sqInt aContext);
@@ -1275,9 +1276,9 @@
 _iss usqInt method;
 _iss StackPage * stackPage;
 _iss sqInt bytecodeSetSelector;
+_iss usqInt freeStart;
 _iss usqInt instructionPointer;
 _iss sqInt argumentCount;
-_iss usqInt freeStart;
 _iss sqInt nilObj;
 _iss usqInt newMethod;
 _iss sqInt messageSelector;
@@ -1296,11 +1297,11 @@
 _iss usqInt memoryLimit;
 _iss StackPage * mostRecentlyUsedPage;
 _iss unsigned char primTraceLogIndex;
+_iss usqInt scavengeThreshold;
 _iss sqInt numStackPages;
-_iss usqInt scavengeThreshold;
+_iss sqInt needGCFlag;
 _iss sqInt jmpDepth;
 _iss sqLong nextProfileTick;
-_iss sqInt needGCFlag;
 _iss usqInt fwdTableNext;
 _iss sqInt longRunningPrimitiveCheckSemaphore;
 _iss sqInt tempOop;
@@ -1323,7 +1324,7 @@
 _iss sqInt highestRunnableProcessPriority;
 _iss usqLong longRunningPrimitiveStartUsecs;
 _iss usqLong longRunningPrimitiveStopUsecs;
-_iss sqInt statCheckForEvents;
+_iss usqLong statCheckForEvents;
 _iss sqInt statGrowMemory;
 _iss sqInt statMarkCount;
 _iss sqInt lastCoggableInterpretedBlockMethod;
@@ -1338,7 +1339,7 @@
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
 _iss sqInt pendingFinalizationSignals;
-_iss sqInt statIOProcessEvents;
+_iss usqLong statIOProcessEvents;
 _iss sqInt edenBytes;
 _iss usqInt fwdTableLast;
 _iss usqLong gcStartUsecs;
@@ -1357,18 +1358,18 @@
 _iss sqInt methodDictLinearSearchLimit;
 _iss usqLong nextPollUsecs;
 _iss sqInt signalLowSpace;
-_iss sqInt statForceInterruptCheck;
+_iss usqLong statForceInterruptCheck;
 _iss usqLong statFullGCUsecs;
 _iss sqInt statFullGCs;
 _iss usqLong statIncrGCUsecs;
 _iss sqInt statIncrGCs;
 _iss sqInt statPendingFinalizationSignals;
-_iss sqInt statProcessSwitch;
+_iss usqLong statProcessSwitch;
 _iss sqInt statRootTableOverflows;
 _iss sqInt statShrinkMemory;
 _iss sqInt statSpecialMarkCount;
-_iss sqInt statStackOverflow;
-_iss sqInt statStackPageDivorce;
+_iss usqLong statStackOverflow;
+_iss usqLong statStackPageDivorce;
 _iss sqInt statTenures;
 _iss sqInt totalObjectCount;
 _iss sqInt extraFramesToMoveOnOverflow;
@@ -2035,7 +2036,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.624";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.630";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -5931,11 +5932,7 @@
 				GIV(stackPointer) = localSP;
 				GIV(framePointer) = localFP;
 				array = eeInstantiateClassIndexformatnumSlots(ClassArrayCompactIndex, 2, size);
-				/* begin internalizeIPandSP */
-				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
-				localIP = pointerForOop(GIV(instructionPointer));
-				localSP = pointerForOop(GIV(stackPointer));
-				localFP = pointerForOop(GIV(framePointer));
+
 				if (popValues) {
 					for (i = 0; i < size; i += 1) {
 
@@ -18388,8 +18385,8 @@
 
 	assert((isImmediate(GIV(messageSelector)))
 	 || (addressCouldBeObj(GIV(messageSelector))));
-	argumentArray = eeInstantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << ShiftForWord)), GIV(argumentCount));
-	message = eeInstantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMessage << ShiftForWord)), 0);
+	argumentArray = eeInstantiateSmallClassnumSlots(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassArray << ShiftForWord)), GIV(argumentCount));
+	message = eeInstantiateSmallClassnumSlots(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassMessage << ShiftForWord)), MessageLookupClassIndex + 1);
 
 	for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) {
 		longAtput((argumentArray + (BaseHeaderSize)) + i, popStack());
@@ -19666,8 +19663,85 @@
 	Since this call is used in routines that do just that we are safe. Break
 	this rule and die in GC.
 	Will *not* cause a GC. Result is guaranteed to be young. */
+/*	cannot have a negative indexable field count */
 
 static sqInt
+eeInstantiateSmallClassIndexformatnumSlots(sqInt compactClassIndex, sqInt objFormat, sqInt numSlots)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hash;
+    sqInt header1;
+    usqInt newChunk;
+    usqInt newFreeStart;
+    sqInt newObj;
+    sqInt sizeInBytes;
+
+	assert((numSlots >= 0)
+	 && (compactClassIndex != 0));
+	assert(((objFormat < (firstByteFormat())
+	? objFormat
+	: objFormat & (byteFormatMask()))) == (instSpecOfClass(compactClassAt(compactClassIndex))));
+	sizeInBytes = (numSlots << ShiftForWord) + BaseHeaderSize;
+	assert(sizeInBytes <= 0xFC);
+	hash = ((usqInt) GIV(freeStart)) >> ShiftForWord;
+	header1 = ((objFormat << (instFormatFieldLSB())) | (compactClassIndex << 12)) | ((hash & HashMaskUnshifted) << HashBitsOffset);
+	header1 += sizeInBytes - (header1 & (SizeMask + Size4Bit));
+	/* begin eeAllocate:headerSize:h1:h2:h3: */
+	/* begin allocateInterpreterChunk: */
+	newChunk = GIV(freeStart);
+	newFreeStart = GIV(freeStart) + (sizeInBytes + ((1 - 1) * BytesPerWord));
+	if (newFreeStart < GIV(scavengeThreshold)) {
+		if ((AllocationCheckFiller != 0)
+		 && ((longAt(newChunk)) != (newChunk))) {
+			error("last object overwritten");
+		}
+		GIV(freeStart) = newFreeStart;
+		newObj = oopForPointer(newChunk);
+		goto l1;
+	}
+	if (GIV(freeStart) < GIV(scavengeThreshold)) {
+		/* begin scheduleIncrementalGC */
+		GIV(needGCFlag) = 1;
+		forceInterruptCheck();
+	}
+	if (newFreeStart < GIV(reserveStart)) {
+		GIV(freeStart) = newFreeStart;
+		newObj = oopForPointer(newChunk);
+		goto l1;
+	}
+	/* begin scheduleIncrementalGC */
+	GIV(needGCFlag) = 1;
+	forceInterruptCheck();
+	if (GIV(freeStart) <= GIV(endOfMemory)) {
+		GIV(freeStart) = newFreeStart;
+		newObj = oopForPointer(newChunk);
+		goto l1;
+	}
+	error("out of memory");
+	newObj = null;
+l1:	/* end allocateInterpreterChunk: */;
+	if (newObj == 0) {
+		return newObj;
+	}
+	
+	
+	longAtput(newObj, header1 | HeaderTypeShort);
+
+	
+	return newObj;
+}
+
+
+/*	This version of instantiateClass assumes that the total object size is
+	under 256 bytes, the limit for objects with only one or two header words. 
+	NOTE this code will only work for sizes that are an integral number of
+	words (hence not a 32-bit LargeInteger in a 64-bit system).
+	Note that the created small object IS NOT FILLED and must be completed
+	before returning it to Squeak.
+	Since this call is used in routines that do just that we are safe. Break
+	this rule and die in GC.
+	Will *not* cause a GC. Result is guaranteed to be young. */
+
+static sqInt
 eeInstantiateSmallClassnumSlots(sqInt classPointer, sqInt numSlots)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt hash;
@@ -21932,7 +22006,7 @@
 {
     sqInt newFloatObj;
 
-	newFloatObj = eeInstantiateClassIndexformatnumSlots(ClassFloatCompactIndex, 6, ((sqInt) 8 >> 2));
+	newFloatObj = eeInstantiateSmallClassIndexformatnumSlots(ClassFloatCompactIndex, 6, ((sqInt) 8 >> 2));
 	storeFloatAtfrom(newFloatObj + (BaseHeaderSize), aFloat);
 	return newFloatObj;
 }
@@ -29205,19 +29279,19 @@
     sqInt fieldOop;
 
 	return (((((usqInt) (longAt(objOop))) >> (instFormatFieldLSB())) & 15) <= 4)
-	 && (((numSlotsOf(objOop)) >= (InstanceSpecificationIndex + 1))
+	 && (((numSlotsOf(objOop)) > InstanceSpecificationIndex)
 	 && (((fieldOop = longAt((objOop + BaseHeaderSize) + (SuperclassIndex << ShiftForWord))),
-	((((fieldOop & 1) == 0)
- && (((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4))
- || ((((((usqInt) (longAt(objOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
+	(((fieldOop & 1) == 0)
+ && ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
+ || ((((((usqInt) (longAt(fieldOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
  && (0
- && (isPointers(followForwarded(fieldOop))))))
+ && (isPointers(followForwarded(fieldOop)))))))
 		 && (((fieldOop = longAt((objOop + BaseHeaderSize) + (MethodDictionaryIndex << ShiftForWord))),
-		((((fieldOop & 1) == 0)
- && (((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4))
- || ((((((usqInt) (longAt(objOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
+		(((fieldOop & 1) == 0)
+ && ((((((usqInt) (longAt(fieldOop))) >> (instFormatFieldLSB())) & 15) <= 4)
+ || ((((((usqInt) (longAt(fieldOop))) >> HashBitsOffset) & HashMaskUnshifted) == 0)
  && (0
- && (isPointers(followForwarded(fieldOop))))))
+ && (isPointers(followForwarded(fieldOop)))))))
 			 && (((longAt((objOop + BaseHeaderSize) + (InstanceSpecificationIndex << ShiftForWord))) & 1)))))));
 }
 
@@ -29709,9 +29783,8 @@
 }
 
 
-/*	Note - integerValue is interpreted as POSITIVE, eg, as the result of
-	Bitmap>at:, or integer>bitAnd:.
- */
+/*	N.B. will *not* cause a GC.
+	integerValue is interpreted as POSITIVE, e.g. as the result of Bitmap>at:. */
 
 sqInt
 positive32BitIntegerFor(sqInt integerValue)
@@ -29722,7 +29795,7 @@
 	 && ((integerValue ^ (integerValue << 1)) >= 0)) {
 		return ((integerValue << 1) | 1);
 	}
-	newLargeInteger = eeInstantiateClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + (4 & 3), 1);
+	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + (4 & 3), 1);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 3, (((usqInt) integerValue) >> 24) & 0xFF);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 2, (((usqInt) integerValue) >> 16) & 0xFF);
 	byteAtput((newLargeInteger + BaseHeaderSize) + 1, (((usqInt) integerValue) >> 8) & 0xFF);
@@ -29781,21 +29854,16 @@
 }
 
 
-/*	Note - integerValue is interpreted as POSITIVE, eg, as the result of
-	Bitmap>at:, or integer>bitAnd:. */
+/*	N.B. will *not* cause a GC.
+	integerValue is interpreted as POSITIVE, e.g. as the result of Bitmap>at:. */
 
 sqInt
 positive64BitIntegerFor(sqLong integerValue)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+{
     sqInt highWord;
-    sqInt i;
     sqInt newLargeInteger;
     sqInt sz;
-    sqInt value;
 
-	if ((sizeof(integerValue)) == 4) {
-		return positive32BitIntegerFor(integerValue);
-	}
 
 	/* shift is coerced to usqInt otherwise */
 
@@ -29813,11 +29881,15 @@
 	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
 		sz += 1;
 	}
-	newLargeInteger = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassLargePositiveInteger << ShiftForWord)), sz);
-	for (i = 0; i < sz; i += 1) {
-		value = (integerValue >> (i * 8)) & 255;
-		byteAtput((newLargeInteger + BaseHeaderSize) + i, value);
-	}
+	newLargeInteger = eeInstantiateSmallClassIndexformatnumSlots(ClassLargePositiveIntegerCompactIndex, 8 + (sz & 3), ((sqInt) 8 >> 2));
+	byteAtput((newLargeInteger + BaseHeaderSize) + 7, (((unsigned sqLong)integerValue) >> 56) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 6, (((unsigned sqLong)integerValue) >> 48) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 5, (((unsigned sqLong)integerValue) >> 40) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 4, (((unsigned sqLong)integerValue) >> 32) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 3, (((unsigned sqLong)integerValue) >> 24) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 2, (((unsigned sqLong)integerValue) >> 16) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 1, (((unsigned sqLong)integerValue) >> 8) & 0xFF);
+	byteAtput((newLargeInteger + BaseHeaderSize) + 0, integerValue & 0xFF);
 	return newLargeInteger;
 }
 
@@ -44856,7 +44928,13 @@
     sqInt valuePointer15;
     sqInt valuePointer16;
     sqInt valuePointer17;
+    sqInt valuePointer18;
+    sqInt valuePointer19;
     sqInt valuePointer2;
+    sqInt valuePointer20;
+    sqInt valuePointer21;
+    sqInt valuePointer22;
+    sqInt valuePointer23;
     sqInt valuePointer3;
     sqInt valuePointer4;
     sqInt valuePointer5;
@@ -44872,10 +44950,10 @@
 		valuePointer = (((GIV(freeStart) - (startOfMemory())) << 1) | 1);
 		longAtput((result + BaseHeaderSize) + (0 << ShiftForWord), valuePointer);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer1 = (((GIV(youngStart) - (startOfMemory())) << 1) | 1);
+		valuePointer1 = positive64BitIntegerFor(GIV(youngStart) - (startOfMemory()));
 		longAtput((result + BaseHeaderSize) + (1 << ShiftForWord), valuePointer1);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer2 = (((GIV(endOfMemory) - (startOfMemory())) << 1) | 1);
+		valuePointer2 = positive64BitIntegerFor(GIV(endOfMemory) - (startOfMemory()));
 		longAtput((result + BaseHeaderSize) + (2 << ShiftForWord), valuePointer2);
 		longAtput((result + BaseHeaderSize) + (3 << ShiftForWord), GIV(nilObj));
 		longAtput((result + BaseHeaderSize) + (4 << ShiftForWord), GIV(nilObj));
@@ -44944,27 +45022,39 @@
 		for (i = 49; i <= 54; i += 1) {
 			longAtput((result + BaseHeaderSize) + (i << ShiftForWord), GIV(nilObj));
 		}
-		longAtput((result + BaseHeaderSize) + (55 << ShiftForWord), ((GIV(statProcessSwitch) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (56 << ShiftForWord), ((GIV(statIOProcessEvents) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (57 << ShiftForWord), ((GIV(statForceInterruptCheck) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (58 << ShiftForWord), ((GIV(statCheckForEvents) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (59 << ShiftForWord), ((GIV(statStackOverflow) << 1) | 1));
-		longAtput((result + BaseHeaderSize) + (60 << ShiftForWord), ((GIV(statStackPageDivorce) << 1) | 1));
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer11 = getCodeCompactionCount();
-		longAtput((result + BaseHeaderSize) + (61 << ShiftForWord), valuePointer11);
+		valuePointer11 = positive64BitIntegerFor(GIV(statProcessSwitch));
+		longAtput((result + BaseHeaderSize) + (55 << ShiftForWord), valuePointer11);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer12 = getCodeCompactionMSecs();
-		longAtput((result + BaseHeaderSize) + (0x3E << ShiftForWord), valuePointer12);
+		valuePointer12 = positive64BitIntegerFor(GIV(statIOProcessEvents));
+		longAtput((result + BaseHeaderSize) + (56 << ShiftForWord), valuePointer12);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer13 = (((numMethodsOfType(CMMethod)) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (0x3F << ShiftForWord), valuePointer13);
+		valuePointer13 = positive64BitIntegerFor(GIV(statForceInterruptCheck));
+		longAtput((result + BaseHeaderSize) + (57 << ShiftForWord), valuePointer13);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer14 = GIV(trueObj);
-		longAtput((result + BaseHeaderSize) + (64 << ShiftForWord), valuePointer14);
+		valuePointer14 = positive64BitIntegerFor(GIV(statCheckForEvents));
+		longAtput((result + BaseHeaderSize) + (58 << ShiftForWord), valuePointer14);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer15 = (((stackPageByteSize()) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (65 << ShiftForWord), valuePointer15);
+		valuePointer15 = positive64BitIntegerFor(GIV(statStackOverflow));
+		longAtput((result + BaseHeaderSize) + (59 << ShiftForWord), valuePointer15);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer16 = positive64BitIntegerFor(GIV(statStackPageDivorce));
+		longAtput((result + BaseHeaderSize) + (60 << ShiftForWord), valuePointer16);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer17 = getCodeCompactionCount();
+		longAtput((result + BaseHeaderSize) + (61 << ShiftForWord), valuePointer17);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer18 = getCodeCompactionMSecs();
+		longAtput((result + BaseHeaderSize) + (0x3E << ShiftForWord), valuePointer18);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer19 = (((numMethodsOfType(CMMethod)) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (0x3F << ShiftForWord), valuePointer19);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer20 = GIV(trueObj);
+		longAtput((result + BaseHeaderSize) + (64 << ShiftForWord), valuePointer20);
+		/* begin storePointerUnchecked:ofObject:withValue: */
+		valuePointer21 = (((stackPageByteSize()) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (65 << ShiftForWord), valuePointer21);
 		for (i = 66; i <= 68; i += 1) {
 
 			/* reserved for more Cog-related info */
@@ -44972,11 +45062,11 @@
 			longAtput((result + BaseHeaderSize) + (i << ShiftForWord), GIV(nilObj));
 		}
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer16 = (((VM_PROXY_MAJOR) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (69 << ShiftForWord), valuePointer16);
+		valuePointer22 = (((VM_PROXY_MAJOR) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (69 << ShiftForWord), valuePointer22);
 		/* begin storePointerUnchecked:ofObject:withValue: */
-		valuePointer17 = (((VM_PROXY_MINOR) << 1) | 1);
-		longAtput((result + BaseHeaderSize) + (70 << ShiftForWord), valuePointer17);
+		valuePointer23 = (((VM_PROXY_MINOR) << 1) | 1);
+		longAtput((result + BaseHeaderSize) + (70 << ShiftForWord), valuePointer23);
 		assert(paramsArraySize == 71);
 		/* begin pop:thenPush: */
 		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), result);
@@ -45003,10 +45093,10 @@
 			result = (((GIV(freeStart) - (startOfMemory())) << 1) | 1);
 		}
 		if (arg == 2) {
-			result = (((GIV(youngStart) - (startOfMemory())) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(youngStart) - (startOfMemory()));
 		}
 		if (arg == 3) {
-			result = (((GIV(endOfMemory) - (startOfMemory())) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(endOfMemory) - (startOfMemory()));
 		}
 		if (arg == 4) {
 
@@ -45140,22 +45230,22 @@
 			result = (((ioGetMaxExtSemTableSize()) << 1) | 1);
 		}
 		if (arg == 56) {
-			result = ((GIV(statProcessSwitch) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statProcessSwitch));
 		}
 		if (arg == 57) {
-			result = ((GIV(statIOProcessEvents) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statIOProcessEvents));
 		}
 		if (arg == 58) {
-			result = ((GIV(statForceInterruptCheck) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statForceInterruptCheck));
 		}
 		if (arg == 59) {
-			result = ((GIV(statCheckForEvents) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statCheckForEvents));
 		}
 		if (arg == 60) {
-			result = ((GIV(statStackOverflow) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statStackOverflow));
 		}
 		if (arg == 61) {
-			result = ((GIV(statStackPageDivorce) << 1) | 1);
+			result = positive64BitIntegerFor(GIV(statStackPageDivorce));
 		}
 		if (arg == 0x3E) {
 			result = getCodeCompactionCount();
@@ -52504,7 +52594,7 @@
 
 
 /*	Answer the startPC of lit if it is a (clean) block in aMethodObj,
-	oitherwise answer nil.
+	otherwise answer nil.
  */
 
 sqInt
@@ -52513,15 +52603,11 @@
     sqInt oop;
     sqInt outerContext;
 
-	if ((lit & 1)) {
+	if (!(((lit & 1) == 0)
+		 && ((((((usqInt) (longAt(lit))) >> (instFormatFieldLSB())) & 15) == 3)
+		 && ((numSlotsOf(lit)) >= ClosureCopiedValuesIndex)))) {
 		return null;
 	}
-	if ((lastPointerOf(lit)) <= ClosureCopiedValuesIndex) {
-		return null;
-	}
-	if (((((usqInt) (longAt(lit))) >> (instFormatFieldLSB())) & 15) == 2) {
-		return null;
-	}
 	outerContext = longAt((lit + BaseHeaderSize) + (ClosureOuterContextIndex << ShiftForWord));
 	if (!(((outerContext & 1) == 0)
 		 && (((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == ClassMethodContextCompactIndex))) {

Modified: branches/Cog/nscogsrc/vm/interp.h
===================================================================
--- branches/Cog/nscogsrc/vm/interp.h	2014-03-01 15:54:53 UTC (rev 2871)
+++ branches/Cog/nscogsrc/vm/interp.h	2014-03-06 20:51:00 UTC (rev 2872)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
  */
 
 #define VM_PROXY_MAJOR 1

Modified: branches/Cog/nscogsrc/vm/vmCallback.h
===================================================================
--- branches/Cog/nscogsrc/vm/vmCallback.h	2014-03-01 15:54:53 UTC (rev 2871)
+++ branches/Cog/nscogsrc/vm/vmCallback.h	2014-03-06 20:51:00 UTC (rev 2872)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
  */
 
 #define VM_CALLBACK_INC 1

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2014-03-01 15:54:53 UTC (rev 2871)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2014-03-06 20:51:00 UTC (rev 2872)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
    from
-	CoInterpreter VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073
+	CoInterpreter VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.624 uuid: 7671143a-d3d3-45cb-b481-210d4d0c4073 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.630 uuid: 8ca18389-543a-4847-958c-8e818a7e0900 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1412,13 +1412,13 @@
 _iss sqInt bytecodeSetSelector;
 _iss sqInt argumentCount;
 _iss usqInt instructionPointer;
+_iss usqInt freeStart;
 _iss sqInt messageSelector;
 _iss usqInt newMethod;
 _iss usqInt newSpaceLimit;
 _iss StackPage * pages;
 _iss sqInt hiddenRootsObj;
 _iss char * stackBasePlus1;
-_iss usqInt freeStart;
 _iss SpurCircularBuffer highestObjects;
 _iss usqInt endOfMemory;
 _iss sqInt totalFreeOldSpace;
@@ -1426,6 +1426,7 @@
 _iss sqInt falseObj;
 _iss sqInt remapBufferCount;
 _iss SpurSegmentInfo * segments;
+_iss sqInt needGCFlag;
 _iss sqInt traceLogIndex;
 _iss sqInt bytesPerPage;
 _iss sqInt * freeLists;
@@ -1434,6 +1435,7 @@
 _iss char * stackLimit;
 _iss sqInt numSegments;
 _iss sqInt firstFreeChunk;
+_iss usqInt scavengeThreshold;
 _iss sqInt weaklingStack;
 _iss sqInt rememberedSetSize;
 _iss SpurNewSpaceSpace pastSpace;
@@ -1459,7 +1461,6 @@
 _iss sqInt profileSemaphore;
 _iss sqInt tenureThreshold;
 _iss sqInt ephemeronList;
-_iss sqInt needGCFlag;
 _iss sqInt profileProcess;
 _iss sqInt extraRootCount;
 _iss sqInt invalidObjStackPage;
@@ -1483,7 +1484,7 @@
 _iss usqLong longRunningPrimitiveStartUsecs;
 _iss usqLong longRunningPrimitiveStopUsecs;
 _iss sqInt numSegInfos;
-_iss sqInt statCheckForEvents;
+_iss usqLong statCheckForEvents;
 _iss sqInt gcMode;
 _iss sqInt lastCoggableInterpretedBlockMethod;
 _iss sqInt lastUncoggableInterpretedBlockMethod;
@@ -1493,8 +1494,7 @@
 _iss sqInt externalPrimitiveTableFirstFreeIndex;
 _iss sqInt flagInterpretedMethods;
 _iss sqInt pendingFinalizationSignals;
-_iss usqInt scavengeThreshold;
-_iss sqInt statIOProcessEvents;
+_iss usqLong statIOProcessEvents;
 _iss sqInt weakList;
 _iss sqInt firstSegmentSize;
 _iss usqLong gcStartUsecs;
@@ -1513,10 +1513,10 @@
 _iss sqInt methodDictLinearSearchLimit;
 _iss usqLong nextPollUsecs;
 _iss sqInt scavengeInProgress;
-_iss sqInt statForceInterruptCheck;
-_iss sqInt statProcessSwitch;
-_iss sqInt statStackOverflow;
-_iss sqInt statStackPageDivorce;
+_iss usqLong statForceInterruptCheck;
+_iss usqLong statProcessSwitch;
+_iss usqLong statStackOverflow;
+_iss usqLong statStackPageDivorce;
 _iss sqInt extraFramesToMoveOnOverflow;
 _iss sqInt globalSessionID;
 _iss sqInt interruptKeycode;
@@ -2185,7 +2185,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 usqInt heapBase;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.624";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreter_VMMaker.oscog-eem.630";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 10 */;
 volatile int sendTrace;
 
@@ -4977,7 +4977,7 @@
 						? ((longAt(localFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
 						: (byteAt((localFP + FoxIFrameFlags) + 3)) != 0))) {
 					goto commonCallerReturn;
-					goto l270;
+					goto l282;
 				}
 				closure = longAt(localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
 	? ((mframeCogMethod(localFP))->cmNumArgs)
@@ -5014,11 +5014,11 @@
 					theMethod = longAt((home + (BaseHeaderSize)) + (MethodIndex << 2));
 					if ((primitiveIndexOfMethodheader(theMethod, headerOf(theMethod))) == 198) {
 						unwindContextOrNilOrZero = home;
-						goto l271;
+						goto l283;
 					}
 				}
 				unwindContextOrNilOrZero = ctxtOrNilOrZero;
-			l271:	/* end internalFindUnwindThroughContext: */;
+			l283:	/* end internalFindUnwindThroughContext: */;
 				if (unwindContextOrNilOrZero == GIV(nilObj)) {
 
 					/* error: can't find home on chain; cannot return */
@@ -5032,10 +5032,10 @@
 						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 						assert(isContext(frameContext(localFP)));
 						ourContext = longAt(localFP + FoxThisContext);
-						goto l272;
+						goto l284;
 					}
 					ourContext = marryFrameSP(localFP, localSP);
-				l272:	/* end ensureFrameIsMarried:SP: */;
+				l284:	/* end ensureFrameIsMarried:SP: */;
 					/* begin internalPush: */
 					longAtPointerput((localSP -= BytesPerOop), ourContext);
 					/* begin internalPush: */
@@ -5044,7 +5044,7 @@
 					GIV(argumentCount) = 1;
 					goto normalSend;
 					/* return self */
-					goto l270;
+					goto l282;
 				}
 				if (unwindContextOrNilOrZero != 0) {
 					/* begin internalAboutToReturn:through: */
@@ -5056,10 +5056,10 @@
 						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 						assert(isContext(frameContext(localFP)));
 						ourContext1 = longAt(localFP + FoxThisContext);
-						goto l273;
+						goto l285;
 					}
 					ourContext1 = marryFrameSP(localFP, localSP);
-				l273:	/* end ensureFrameIsMarried:SP: */;
+				l285:	/* end ensureFrameIsMarried:SP: */;
 					/* begin internalPush: */
 					longAtPointerput((localSP -= BytesPerOop), ourContext1);
 					/* begin internalPush: */
@@ -5070,7 +5070,7 @@
 					GIV(argumentCount) = 2;
 					goto normalSend;
 					/* return self */
-					goto l270;
+					goto l282;
 				}
 				contextToReturnTo = null;
 				if (((longAt((home + (BaseHeaderSize)) + (SenderIndex << 2))) & 1)) {
@@ -5129,10 +5129,10 @@
 							: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 							assert(isContext(frameContext(localFP)));
 							ourContext2 = longAt(localFP + FoxThisContext);
-							goto l274;
+							goto l286;
 						}
 						ourContext2 = marryFrameSP(localFP, localSP);
-					l274:	/* end ensureFrameIsMarried:SP: */;
+					l286:	/* end ensureFrameIsMarried:SP: */;
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), ourContext2);
 						/* begin internalPush: */
@@ -5141,7 +5141,7 @@
 						GIV(argumentCount) = 1;
 						goto normalSend;
 						/* return self */
-						goto l270;
+						goto l282;
 					}
 				}
 				assert(pageListIsWellFormed());
@@ -5256,7 +5256,7 @@
 						GIV(framePointer) = localFP;
 						
 						ceEnterCogCodePopReceiverReg();
-						goto l270;
+						goto l282;
 					}
 					localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
 				}
@@ -5274,7 +5274,7 @@
 
 				/* return self */
 			}
-		l270:	/* end case */;
+		l282:	/* end case */;
 			break;
 		case 121:
 			/* returnTrue */
@@ -5394,27 +5394,27 @@
 							fp = (thePage->headFP);
 							if (fp == theFP) {
 								frameAbove = 0;
-								goto l276;
+								goto l288;
 							}
 							while (((callerFP = frameCallerFP(fp))) != 0) {
 								if (callerFP == theFP) {
 									frameAbove = fp;
-									goto l276;

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list