[Vm-dev] [commit][3434] CogVM source as per VMMaker.oscog-eem.1449

commits at squeakvm.org commits at squeakvm.org
Mon Sep 14 18:14:03 UTC 2015


Revision: 3434
Author:   eliot
Date:     2015-09-14 11:14:01 -0700 (Mon, 14 Sep 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1449

Fix positive32BitValueOf: & signed32BitValueOf: for 64-bit Spur;
these must fail for SmallIntegers with digitLength > 4.

Modify secret primtiive 161, primitiveSetIdentityHash so that with 0 args it
answers whether an object has an identity hash.  This is vacuously true for V3,
but is meaningful in Spur.

Update the Newspeak FilePlugin to be the same as the Smalltalk one.

Modified Paths:
--------------
    branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
    branches/Cog/nsspurstack64src/vm/interp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/spursistasrc/vm/cogit.h
    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/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spurstack64src/vm/gcc3x-interp.c
    branches/Cog/spurstack64src/vm/interp.c
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/src/vm/cogit.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/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c

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

Modified: branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c
===================================================================
--- branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
+	VMPluginCodeGenerator VMMaker.oscog-eem.1448 uuid: 987a0908-6f37-437b-80a8-4db22a6e92bd
    from
-	FilePlugin VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
+	FilePlugin VMMaker.oscog-eem.1448 uuid: 987a0908-6f37-437b-80a8-4db22a6e92bd
  */
-static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b " __DATE__ ;
+static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.1448 uuid: 987a0908-6f37-437b-80a8-4db22a6e92bd " __DATE__ ;
 
 
 
@@ -41,7 +41,9 @@
 #define COGMTVM 0
 #define DirBadPath 2
 #define DirNoMoreEntries 1
-#define PharoVM 0
+#if !defined(PharoVM) /* Allow PharoVM to be overridden on the compiler command line */
+# define PharoVM 0
+#endif
 #define PrimErrBadArgument 3
 #define PrimErrBadIndex 4
 #define PrimErrNoMemory 9
@@ -178,9 +180,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FilePlugin VMMaker.oscog-eem.1417 (i)"
+	"FilePlugin VMMaker.oscog-eem.1448 (i)"
 #else
-	"FilePlugin VMMaker.oscog-eem.1417 (e)"
+	"FilePlugin VMMaker.oscog-eem.1448 (e)"
 #endif
 ;
 static void * sCCPfn;

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-09-14 18:14:01 UTC (rev 3434)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGenerator VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
    from
-	CoInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CoInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -796,9 +796,9 @@
 static void primitiveSecondsClock(void);
 static void primitiveSetDisplayMode(void);
 static void primitiveSetFullScreen(void);
-static void primitiveSetIdentityHash(void);
 static void primitiveSetInterruptKey(void);
 EXPORT(sqInt) primitiveSetLogDirectory(void);
+static void primitiveSetOrHasIdentityHash(void);
 EXPORT(sqInt) primitiveSetWindowLabel(void);
 EXPORT(sqInt) primitiveSetWindowSize(void);
 static void primitiveShortAt(void);
@@ -1212,7 +1212,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 sqInt stringForCString(const char *aCString);
+extern usqInt stringForCString(const char *aCString);
 static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
 static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
 extern void tenuringIncrementalGC(void);
@@ -1599,8 +1599,8 @@
 _iss sqInt weaklingStack;
 _iss usqInt newSpaceStart;
 _iss sqInt lkupClassTag;
+_iss sqInt trueObj;
 _iss SpurSegmentInfo * segments;
-_iss sqInt trueObj;
 _iss sqInt falseObj;
 _iss sqInt hiddenRootsObj;
 _iss usqInt scavengeThreshold;
@@ -1966,7 +1966,7 @@
 	/* 158 */ (void (*)(void))0,
 	/* 159 */ (void (*)(void))0,
 	/* 160 */ primitiveAdoptInstance,
-	/* 161 */ primitiveSetIdentityHash,
+	/* 161 */ primitiveSetOrHasIdentityHash,
 	/* 162 */ (void (*)(void))0,
 	/* 163 */ (void (*)(void))0,
 	/* 164 */ (void (*)(void))0,
@@ -2414,7 +2414,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.1447";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1449";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -30183,7 +30183,8 @@
 
 	if ((oop & 1)) {
 		value = (oop >> 1);
-		if (value < 0) {
+		if ((value < 0)
+		 || (0)) {
 			/* begin primitiveFail */
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
@@ -32320,7 +32321,7 @@
     usqInt newObj;
     usqInt numBytes;
     sqInt numSlots;
-    usqInt s;
+    sqInt s;
     char *sp;
     sqInt sz;
 
@@ -32369,7 +32370,7 @@
 				GIV(needGCFlag) = 1;
 				forceInterruptCheck();
 			}
-			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+			s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex)));
 			goto l1;
 		}
 		if (numSlots >= 0xFF) {
@@ -40242,74 +40243,7 @@
 	}
 }
 
-	/* InterpreterPrimitives>>#primitiveSetIdentityHash */
-static void
-primitiveSetIdentityHash(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt hash;
-    sqInt hash1;
-    sqInt integerPointer;
-    sqInt oldHash;
-    sqInt oop;
-    char *sp;
-    sqInt thisReceiver;
 
-	/* begin stackIntegerValue: */
-	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		hash = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		hash = 0;
-		goto l1;
-	}
-l1:	/* end stackIntegerValue: */;
-	/* begin stackObjectValue: */
-	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
-	if ((oop & 3) != 0) {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		thisReceiver = null;
-		goto l2;
-	}
-	thisReceiver = oop;
-l2:	/* end stackObjectValue: */;
-	if (!GIV(primFailCode)) {
-		/* begin hashBitsOf: */
-		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
-		if (hash1 == 0) {
-
-			/* would like to assert
-			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
-			   but instance-specific behaviors that are instances of themselves may
-			   fail this test. */
-
-			hash1 = (newObjectHash()) & 0x3FFFFF;
-			/* begin setHashBitsOf:to: */
-			flag("endianness");
-			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
-			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
-		}
-		oldHash = hash1;
-		/* begin setHashBitsOf:to: */
-		flag("endianness");
-		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
-		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
-		/* begin pop:thenPushInteger: */
-		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
-		GIV(stackPointer) = sp;
-	}
-}
-
-
 /*	Set the user interrupt keycode. The keycode is an integer whose encoding
 	is described in the comment for primitiveKbdNext.
  */
@@ -40412,7 +40346,85 @@
 	}
 }
 
+	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
+static void
+primitiveSetOrHasIdentityHash(void)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hasHash;
+    sqInt hash;
+    sqInt hash1;
+    sqInt integerPointer;
+    sqInt oldHash;
+    sqInt oop;
+    char *sp;
+    char *sp1;
+    sqInt thisReceiver;
 
+	if (GIV(argumentCount) == 0) {
+		hasHash = (((longAt(GIV(stackPointer))) & 3) == 0)
+		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF);
+		/* begin pop:thenPushBool: */
+		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
+			? GIV(trueObj)
+			: GIV(falseObj)));
+		GIV(stackPointer) = sp;
+	}
+	/* begin stackIntegerValue: */
+	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
+	/* begin checkedIntegerValueOf: */
+	if ((integerPointer & 1)) {
+		hash = (integerPointer >> 1);
+		goto l1;
+	}
+	else {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		hash = 0;
+		goto l1;
+	}
+l1:	/* end stackIntegerValue: */;
+	/* begin stackObjectValue: */
+	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
+	if ((oop & 3) != 0) {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		thisReceiver = null;
+		goto l2;
+	}
+	thisReceiver = oop;
+l2:	/* end stackObjectValue: */;
+	if (!GIV(primFailCode)) {
+		/* begin hashBitsOf: */
+		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
+		if (hash1 == 0) {
+
+			/* would like to assert
+			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
+			   but instance-specific behaviors that are instances of themselves may
+			   fail this test. */
+
+			hash1 = (newObjectHash()) & 0x3FFFFF;
+			/* begin setHashBitsOf:to: */
+			flag("endianness");
+			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
+			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
+		}
+		oldHash = hash1;
+		/* begin setHashBitsOf:to: */
+		flag("endianness");
+		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
+		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
+		/* begin pop:thenPushInteger: */
+		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
+		GIV(stackPointer) = sp1;
+	}
+}
+
+
 /*	Primitive. Set the OS window's label */
 
 	/* InterpreterPrimitives>>#primitiveSetWindowLabel */
@@ -42653,9 +42665,11 @@
     sqInt negative;
     sqInt ok;
     int value;
+    long value64;
 
 	if ((oop & 1)) {
 		return (oop >> 1);
+
 	}
 	if ((oop & 3) != 0) {
 		/* begin primitiveFail */
@@ -46214,7 +46228,7 @@
     sqInt ptr2;
     sqInt slotBytes;
     usqInt smallObj;
-    sqInt start;
+    usqInt start;
 
 	classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
 	if (classIndex == 0) {
@@ -60562,7 +60576,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    sqInt prevPrevFreeChunk;
+    usqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -64421,7 +64435,7 @@
 	or nil if out of memory. */
 
 	/* SpurMemoryManager>>#stringForCString: */
-sqInt
+usqInt
 stringForCString(const char *aCString)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt formatField;
@@ -65137,7 +65151,7 @@
 bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil)
 {
     usqInt bridgeSpan;
-    sqInt clifton;
+    usqInt clifton;
     usqInt segEnd;
 
 	segEnd = ((aSegment->segSize)) + ((aSegment->segStart));

Modified: branches/Cog/nsspursrc/vm/cointerp.h
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.h	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspursrc/vm/cointerp.h	2015-09-14 18:14:01 UTC (rev 3434)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
 
 
@@ -258,7 +258,7 @@
 extern sqInt splObj(sqInt index);
 extern usqInt storeCheckBoundary(void);
 extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-extern sqInt stringForCString(const char *aCString);
+extern usqInt stringForCString(const char *aCString);
 extern void tenuringIncrementalGC(void);
 extern sqInt topRemappableOop(void);
 extern sqInt validFreeTree(void);

Modified: branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspursrc/vm/gcc3x-cointerp.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
    from
-	CoInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CoInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -799,9 +799,9 @@
 static void primitiveSecondsClock(void);
 static void primitiveSetDisplayMode(void);
 static void primitiveSetFullScreen(void);
-static void primitiveSetIdentityHash(void);
 static void primitiveSetInterruptKey(void);
 EXPORT(sqInt) primitiveSetLogDirectory(void);
+static void primitiveSetOrHasIdentityHash(void);
 EXPORT(sqInt) primitiveSetWindowLabel(void);
 EXPORT(sqInt) primitiveSetWindowSize(void);
 static void primitiveShortAt(void);
@@ -1215,7 +1215,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 sqInt stringForCString(const char *aCString);
+extern usqInt stringForCString(const char *aCString);
 static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
 static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
 extern void tenuringIncrementalGC(void);
@@ -1602,8 +1602,8 @@
 _iss sqInt weaklingStack;
 _iss usqInt newSpaceStart;
 _iss sqInt lkupClassTag;
+_iss sqInt trueObj;
 _iss SpurSegmentInfo * segments;
-_iss sqInt trueObj;
 _iss sqInt falseObj;
 _iss sqInt hiddenRootsObj;
 _iss usqInt scavengeThreshold;
@@ -1969,7 +1969,7 @@
 	/* 158 */ (void (*)(void))0,
 	/* 159 */ (void (*)(void))0,
 	/* 160 */ primitiveAdoptInstance,
-	/* 161 */ primitiveSetIdentityHash,
+	/* 161 */ primitiveSetOrHasIdentityHash,
 	/* 162 */ (void (*)(void))0,
 	/* 163 */ (void (*)(void))0,
 	/* 164 */ (void (*)(void))0,
@@ -2417,7 +2417,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.1447";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1449";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -30192,7 +30192,8 @@
 
 	if ((oop & 1)) {
 		value = (oop >> 1);
-		if (value < 0) {
+		if ((value < 0)
+		 || (0)) {
 			/* begin primitiveFail */
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
@@ -32329,7 +32330,7 @@
     usqInt newObj;
     usqInt numBytes;
     sqInt numSlots;
-    usqInt s;
+    sqInt s;
     char *sp;
     sqInt sz;
 
@@ -32378,7 +32379,7 @@
 				GIV(needGCFlag) = 1;
 				forceInterruptCheck();
 			}
-			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+			s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex)));
 			goto l1;
 		}
 		if (numSlots >= 0xFF) {
@@ -40251,74 +40252,7 @@
 	}
 }
 
-	/* InterpreterPrimitives>>#primitiveSetIdentityHash */
-static void
-primitiveSetIdentityHash(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt hash;
-    sqInt hash1;
-    sqInt integerPointer;
-    sqInt oldHash;
-    sqInt oop;
-    char *sp;
-    sqInt thisReceiver;
 
-	/* begin stackIntegerValue: */
-	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		hash = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		hash = 0;
-		goto l1;
-	}
-l1:	/* end stackIntegerValue: */;
-	/* begin stackObjectValue: */
-	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
-	if ((oop & 3) != 0) {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		thisReceiver = null;
-		goto l2;
-	}
-	thisReceiver = oop;
-l2:	/* end stackObjectValue: */;
-	if (!GIV(primFailCode)) {
-		/* begin hashBitsOf: */
-		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
-		if (hash1 == 0) {
-
-			/* would like to assert
-			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
-			   but instance-specific behaviors that are instances of themselves may
-			   fail this test. */
-
-			hash1 = (newObjectHash()) & 0x3FFFFF;
-			/* begin setHashBitsOf:to: */
-			flag("endianness");
-			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
-			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
-		}
-		oldHash = hash1;
-		/* begin setHashBitsOf:to: */
-		flag("endianness");
-		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
-		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
-		/* begin pop:thenPushInteger: */
-		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
-		GIV(stackPointer) = sp;
-	}
-}
-
-
 /*	Set the user interrupt keycode. The keycode is an integer whose encoding
 	is described in the comment for primitiveKbdNext.
  */
@@ -40421,7 +40355,85 @@
 	}
 }
 
+	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
+static void
+primitiveSetOrHasIdentityHash(void)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hasHash;
+    sqInt hash;
+    sqInt hash1;
+    sqInt integerPointer;
+    sqInt oldHash;
+    sqInt oop;
+    char *sp;
+    char *sp1;
+    sqInt thisReceiver;
 
+	if (GIV(argumentCount) == 0) {
+		hasHash = (((longAt(GIV(stackPointer))) & 3) == 0)
+		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF);
+		/* begin pop:thenPushBool: */
+		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
+			? GIV(trueObj)
+			: GIV(falseObj)));
+		GIV(stackPointer) = sp;
+	}
+	/* begin stackIntegerValue: */
+	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
+	/* begin checkedIntegerValueOf: */
+	if ((integerPointer & 1)) {
+		hash = (integerPointer >> 1);
+		goto l1;
+	}
+	else {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		hash = 0;
+		goto l1;
+	}
+l1:	/* end stackIntegerValue: */;
+	/* begin stackObjectValue: */
+	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
+	if ((oop & 3) != 0) {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		thisReceiver = null;
+		goto l2;
+	}
+	thisReceiver = oop;
+l2:	/* end stackObjectValue: */;
+	if (!GIV(primFailCode)) {
+		/* begin hashBitsOf: */
+		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
+		if (hash1 == 0) {
+
+			/* would like to assert
+			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
+			   but instance-specific behaviors that are instances of themselves may
+			   fail this test. */
+
+			hash1 = (newObjectHash()) & 0x3FFFFF;
+			/* begin setHashBitsOf:to: */
+			flag("endianness");
+			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
+			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
+		}
+		oldHash = hash1;
+		/* begin setHashBitsOf:to: */
+		flag("endianness");
+		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
+		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
+		/* begin pop:thenPushInteger: */
+		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
+		GIV(stackPointer) = sp1;
+	}
+}
+
+
 /*	Primitive. Set the OS window's label */
 
 	/* InterpreterPrimitives>>#primitiveSetWindowLabel */
@@ -42662,9 +42674,11 @@
     sqInt negative;
     sqInt ok;
     int value;
+    long value64;
 
 	if ((oop & 1)) {
 		return (oop >> 1);
+
 	}
 	if ((oop & 3) != 0) {
 		/* begin primitiveFail */
@@ -46223,7 +46237,7 @@
     sqInt ptr2;
     sqInt slotBytes;
     usqInt smallObj;
-    sqInt start;
+    usqInt start;
 
 	classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
 	if (classIndex == 0) {
@@ -60571,7 +60585,7 @@
     usqInt prevFree;
     usqInt prevFreeChunk;
     usqInt prevPrevFree;
-    sqInt prevPrevFreeChunk;
+    usqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
@@ -64430,7 +64444,7 @@
 	or nil if out of memory. */
 
 	/* SpurMemoryManager>>#stringForCString: */
-sqInt
+usqInt
 stringForCString(const char *aCString)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt formatField;
@@ -65146,7 +65160,7 @@
 bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil)
 {
     usqInt bridgeSpan;
-    sqInt clifton;
+    usqInt clifton;
     usqInt segEnd;
 
 	segEnd = ((aSegment->segSize)) + ((aSegment->segStart));

Modified: branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstack64src/vm/gcc3x-interp.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspurstack64src/vm/gcc3x-interp.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
    from
-	StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -548,9 +548,9 @@
 static void primitiveSecondsClock(void);
 static void primitiveSetDisplayMode(void);
 static void primitiveSetFullScreen(void);
-static void primitiveSetIdentityHash(void);
 static void primitiveSetInterruptKey(void);
 EXPORT(sqInt) primitiveSetLogDirectory(void);
+static void primitiveSetOrHasIdentityHash(void);
 EXPORT(sqInt) primitiveSetWindowLabel(void);
 EXPORT(sqInt) primitiveSetWindowSize(void);
 static void primitiveShortAt(void);
@@ -1762,7 +1762,7 @@
 	/* 158 */ (void (*)(void))0,
 	/* 159 */ (void (*)(void))0,
 	/* 160 */ primitiveAdoptInstance,
-	/* 161 */ primitiveSetIdentityHash,
+	/* 161 */ primitiveSetOrHasIdentityHash,
 	/* 162 */ (void (*)(void))0,
 	/* 163 */ (void (*)(void))0,
 	/* 164 */ (void (*)(void))0,
@@ -2179,7 +2179,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1447";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1449";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -15500,7 +15500,8 @@
 
 	if ((((oop) & 7) == 1)) {
 		value = (oop >> 3);
-		if (value < 0) {
+		if ((value < 0)
+		 || ((((unsigned int) value)) != value)) {
 			/* begin primitiveFail */
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
@@ -25560,74 +25561,7 @@
 	}
 }
 
-	/* InterpreterPrimitives>>#primitiveSetIdentityHash */
-static void
-primitiveSetIdentityHash(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt hash;
-    sqInt hash1;
-    sqInt integerPointer;
-    sqInt oldHash;
-    sqInt oop;
-    char *sp;
-    sqInt thisReceiver;
 
-	/* begin stackIntegerValue: */
-	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
-	/* begin checkedIntegerValueOf: */
-	if ((((integerPointer) & 7) == 1)) {
-		hash = (integerPointer >> 3);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		hash = 0;
-		goto l1;
-	}
-l1:	/* end stackIntegerValue: */;
-	/* begin stackObjectValue: */
-	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
-	if ((oop & 7) != 0) {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		thisReceiver = null;
-		goto l2;
-	}
-	thisReceiver = oop;
-l2:	/* end stackObjectValue: */;
-	if (!GIV(primFailCode)) {
-		/* begin hashBitsOf: */
-		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
-		if (hash1 == 0) {
-
-			/* would like to assert
-			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
-			   but instance-specific behaviors that are instances of themselves may
-			   fail this test. */
-
-			hash1 = (newObjectHash()) & 0x3FFFFF;
-			/* begin setHashBitsOf:to: */
-			flag("endianness");
-			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
-			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
-		}
-		oldHash = hash1;
-		/* begin setHashBitsOf:to: */
-		flag("endianness");
-		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
-		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
-		/* begin pop:thenPushInteger: */
-		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 3) | 1));
-		GIV(stackPointer) = sp;
-	}
-}
-
-
 /*	Set the user interrupt keycode. The keycode is an integer whose encoding
 	is described in the comment for primitiveKbdNext.
  */
@@ -25730,7 +25664,85 @@
 	}
 }
 
+	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
+static void
+primitiveSetOrHasIdentityHash(void)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hasHash;
+    sqInt hash;
+    sqInt hash1;
+    sqInt integerPointer;
+    sqInt oldHash;
+    sqInt oop;
+    char *sp;
+    char *sp1;
+    sqInt thisReceiver;
 
+	if (GIV(argumentCount) == 0) {
+		hasHash = (((longAt(GIV(stackPointer))) & 7) == 0)
+		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF);
+		/* begin pop:thenPushBool: */
+		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
+			? GIV(trueObj)
+			: GIV(falseObj)));
+		GIV(stackPointer) = sp;
+	}
+	/* begin stackIntegerValue: */
+	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
+	/* begin checkedIntegerValueOf: */
+	if ((((integerPointer) & 7) == 1)) {
+		hash = (integerPointer >> 3);
+		goto l1;
+	}
+	else {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		hash = 0;
+		goto l1;
+	}
+l1:	/* end stackIntegerValue: */;
+	/* begin stackObjectValue: */
+	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
+	if ((oop & 7) != 0) {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		thisReceiver = null;
+		goto l2;
+	}
+	thisReceiver = oop;
+l2:	/* end stackObjectValue: */;
+	if (!GIV(primFailCode)) {
+		/* begin hashBitsOf: */
+		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
+		if (hash1 == 0) {
+
+			/* would like to assert
+			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
+			   but instance-specific behaviors that are instances of themselves may
+			   fail this test. */
+
+			hash1 = (newObjectHash()) & 0x3FFFFF;
+			/* begin setHashBitsOf:to: */
+			flag("endianness");
+			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
+			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
+		}
+		oldHash = hash1;
+		/* begin setHashBitsOf:to: */
+		flag("endianness");
+		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
+		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
+		/* begin pop:thenPushInteger: */
+		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 3) | 1));
+		GIV(stackPointer) = sp1;
+	}
+}
+
+
 /*	Primitive. Set the OS window's label */
 
 	/* InterpreterPrimitives>>#primitiveSetWindowLabel */
@@ -29246,9 +29258,22 @@
     sqInt negative;
     sqInt ok;
     int value;
+    long value64;
 
 	if ((((oop) & 7) == 1)) {
-		return (oop >> 3);
+		
+		/* Must fail for SmallIntegers with digitLength > 4 */
+
+		value64 = (oop >> 3);
+		if ((((int) value64)) != value64) {
+			/* begin primitiveFail */
+			if (!GIV(primFailCode)) {
+				GIV(primFailCode) = 1;
+			}
+			value64 = 0;
+		}
+		return value64;
+
 	}
 	if ((oop & 7) != 0) {
 		/* begin primitiveFail */

Modified: branches/Cog/nsspurstack64src/vm/interp.c
===================================================================
--- branches/Cog/nsspurstack64src/vm/interp.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspurstack64src/vm/interp.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
    from
-	StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -545,9 +545,9 @@
 static void primitiveSecondsClock(void);
 static void primitiveSetDisplayMode(void);
 static void primitiveSetFullScreen(void);
-static void primitiveSetIdentityHash(void);
 static void primitiveSetInterruptKey(void);
 EXPORT(sqInt) primitiveSetLogDirectory(void);
+static void primitiveSetOrHasIdentityHash(void);
 EXPORT(sqInt) primitiveSetWindowLabel(void);
 EXPORT(sqInt) primitiveSetWindowSize(void);
 static void primitiveShortAt(void);
@@ -1759,7 +1759,7 @@
 	/* 158 */ (void (*)(void))0,
 	/* 159 */ (void (*)(void))0,
 	/* 160 */ primitiveAdoptInstance,
-	/* 161 */ primitiveSetIdentityHash,
+	/* 161 */ primitiveSetOrHasIdentityHash,
 	/* 162 */ (void (*)(void))0,
 	/* 163 */ (void (*)(void))0,
 	/* 164 */ (void (*)(void))0,
@@ -2176,7 +2176,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1447";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1449";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -15491,7 +15491,8 @@
 
 	if ((((oop) & 7) == 1)) {
 		value = (oop >> 3);
-		if (value < 0) {
+		if ((value < 0)
+		 || ((((unsigned int) value)) != value)) {
 			/* begin primitiveFail */
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
@@ -25551,74 +25552,7 @@
 	}
 }
 
-	/* InterpreterPrimitives>>#primitiveSetIdentityHash */
-static void
-primitiveSetIdentityHash(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt hash;
-    sqInt hash1;
-    sqInt integerPointer;
-    sqInt oldHash;
-    sqInt oop;
-    char *sp;
-    sqInt thisReceiver;
 
-	/* begin stackIntegerValue: */
-	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
-	/* begin checkedIntegerValueOf: */
-	if ((((integerPointer) & 7) == 1)) {
-		hash = (integerPointer >> 3);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		hash = 0;
-		goto l1;
-	}
-l1:	/* end stackIntegerValue: */;
-	/* begin stackObjectValue: */
-	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
-	if ((oop & 7) != 0) {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		thisReceiver = null;
-		goto l2;
-	}
-	thisReceiver = oop;
-l2:	/* end stackObjectValue: */;
-	if (!GIV(primFailCode)) {
-		/* begin hashBitsOf: */
-		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
-		if (hash1 == 0) {
-
-			/* would like to assert
-			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
-			   but instance-specific behaviors that are instances of themselves may
-			   fail this test. */
-
-			hash1 = (newObjectHash()) & 0x3FFFFF;
-			/* begin setHashBitsOf:to: */
-			flag("endianness");
-			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
-			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
-		}
-		oldHash = hash1;
-		/* begin setHashBitsOf:to: */
-		flag("endianness");
-		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
-		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
-		/* begin pop:thenPushInteger: */
-		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 3) | 1));
-		GIV(stackPointer) = sp;
-	}
-}
-
-
 /*	Set the user interrupt keycode. The keycode is an integer whose encoding
 	is described in the comment for primitiveKbdNext.
  */
@@ -25721,7 +25655,85 @@
 	}
 }
 
+	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
+static void
+primitiveSetOrHasIdentityHash(void)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hasHash;
+    sqInt hash;
+    sqInt hash1;
+    sqInt integerPointer;
+    sqInt oldHash;
+    sqInt oop;
+    char *sp;
+    char *sp1;
+    sqInt thisReceiver;
 
+	if (GIV(argumentCount) == 0) {
+		hasHash = (((longAt(GIV(stackPointer))) & 7) == 0)
+		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF);
+		/* begin pop:thenPushBool: */
+		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
+			? GIV(trueObj)
+			: GIV(falseObj)));
+		GIV(stackPointer) = sp;
+	}
+	/* begin stackIntegerValue: */
+	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
+	/* begin checkedIntegerValueOf: */
+	if ((((integerPointer) & 7) == 1)) {
+		hash = (integerPointer >> 3);
+		goto l1;
+	}
+	else {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		hash = 0;
+		goto l1;
+	}
+l1:	/* end stackIntegerValue: */;
+	/* begin stackObjectValue: */
+	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
+	if ((oop & 7) != 0) {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		thisReceiver = null;
+		goto l2;
+	}
+	thisReceiver = oop;
+l2:	/* end stackObjectValue: */;
+	if (!GIV(primFailCode)) {
+		/* begin hashBitsOf: */
+		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
+		if (hash1 == 0) {
+
+			/* would like to assert
+			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
+			   but instance-specific behaviors that are instances of themselves may
+			   fail this test. */
+
+			hash1 = (newObjectHash()) & 0x3FFFFF;
+			/* begin setHashBitsOf:to: */
+			flag("endianness");
+			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
+			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
+		}
+		oldHash = hash1;
+		/* begin setHashBitsOf:to: */
+		flag("endianness");
+		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
+		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
+		/* begin pop:thenPushInteger: */
+		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 3) | 1));
+		GIV(stackPointer) = sp1;
+	}
+}
+
+
 /*	Primitive. Set the OS window's label */
 
 	/* InterpreterPrimitives>>#primitiveSetWindowLabel */
@@ -29237,9 +29249,22 @@
     sqInt negative;
     sqInt ok;
     int value;
+    long value64;
 
 	if ((((oop) & 7) == 1)) {
-		return (oop >> 3);
+		
+		/* Must fail for SmallIntegers with digitLength > 4 */
+
+		value64 = (oop >> 3);
+		if ((((int) value64)) != value64) {
+			/* begin primitiveFail */
+			if (!GIV(primFailCode)) {
+				GIV(primFailCode) = 1;
+			}
+			value64 = 0;
+		}
+		return value64;
+
 	}
 	if ((oop & 7) != 0) {
 		/* begin primitiveFail */

Modified: branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
    from
-	StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -540,9 +540,9 @@
 static void primitiveSecondsClock(void);
 static void primitiveSetDisplayMode(void);
 static void primitiveSetFullScreen(void);
-static void primitiveSetIdentityHash(void);
 static void primitiveSetInterruptKey(void);
 EXPORT(sqInt) primitiveSetLogDirectory(void);
+static void primitiveSetOrHasIdentityHash(void);
 EXPORT(sqInt) primitiveSetWindowLabel(void);
 EXPORT(sqInt) primitiveSetWindowSize(void);
 static void primitiveShortAt(void);
@@ -1370,8 +1370,8 @@
 _iss usqInt freeStart;
 _iss sqInt nilObj;
 _iss StackPage * stackPage;
+_iss sqInt argumentCount;
 _iss sqInt specialObjectsOop;
-_iss sqInt argumentCount;
 _iss char * framePointer;
 _iss sqInt bytecodeSetSelector;
 _iss sqInt messageSelector;
@@ -1733,7 +1733,7 @@
 	/* 158 */ (void (*)(void))0,
 	/* 159 */ (void (*)(void))0,
 	/* 160 */ primitiveAdoptInstance,
-	/* 161 */ primitiveSetIdentityHash,
+	/* 161 */ primitiveSetOrHasIdentityHash,
 	/* 162 */ (void (*)(void))0,
 	/* 163 */ (void (*)(void))0,
 	/* 164 */ (void (*)(void))0,
@@ -2150,7 +2150,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1447";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1449";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -14855,7 +14855,8 @@
 
 	if ((oop & 1)) {
 		value = (oop >> 1);
-		if (value < 0) {
+		if ((value < 0)
+		 || (0)) {
 			/* begin primitiveFail */
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
@@ -25112,74 +25113,7 @@
 	}
 }
 
-	/* InterpreterPrimitives>>#primitiveSetIdentityHash */
-static void
-primitiveSetIdentityHash(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt hash;
-    sqInt hash1;
-    sqInt integerPointer;
-    sqInt oldHash;
-    sqInt oop;
-    char *sp;
-    sqInt thisReceiver;
 
-	/* begin stackIntegerValue: */
-	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		hash = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		hash = 0;
-		goto l1;
-	}
-l1:	/* end stackIntegerValue: */;
-	/* begin stackObjectValue: */
-	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
-	if ((oop & 3) != 0) {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		thisReceiver = null;
-		goto l2;
-	}
-	thisReceiver = oop;
-l2:	/* end stackObjectValue: */;
-	if (!GIV(primFailCode)) {
-		/* begin hashBitsOf: */
-		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
-		if (hash1 == 0) {
-
-			/* would like to assert
-			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
-			   but instance-specific behaviors that are instances of themselves may
-			   fail this test. */
-
-			hash1 = (newObjectHash()) & 0x3FFFFF;
-			/* begin setHashBitsOf:to: */
-			flag("endianness");
-			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
-			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
-		}
-		oldHash = hash1;
-		/* begin setHashBitsOf:to: */
-		flag("endianness");
-		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
-		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
-		/* begin pop:thenPushInteger: */
-		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
-		GIV(stackPointer) = sp;
-	}
-}
-
-
 /*	Set the user interrupt keycode. The keycode is an integer whose encoding
 	is described in the comment for primitiveKbdNext.
  */
@@ -25282,7 +25216,85 @@
 	}
 }
 
+	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
+static void
+primitiveSetOrHasIdentityHash(void)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hasHash;
+    sqInt hash;
+    sqInt hash1;
+    sqInt integerPointer;
+    sqInt oldHash;
+    sqInt oop;
+    char *sp;
+    char *sp1;
+    sqInt thisReceiver;
 
+	if (GIV(argumentCount) == 0) {
+		hasHash = (((longAt(GIV(stackPointer))) & 3) == 0)
+		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF);
+		/* begin pop:thenPushBool: */
+		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
+			? GIV(trueObj)
+			: GIV(falseObj)));
+		GIV(stackPointer) = sp;
+	}
+	/* begin stackIntegerValue: */
+	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
+	/* begin checkedIntegerValueOf: */
+	if ((integerPointer & 1)) {
+		hash = (integerPointer >> 1);
+		goto l1;
+	}
+	else {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		hash = 0;
+		goto l1;
+	}
+l1:	/* end stackIntegerValue: */;
+	/* begin stackObjectValue: */
+	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
+	if ((oop & 3) != 0) {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		thisReceiver = null;
+		goto l2;
+	}
+	thisReceiver = oop;
+l2:	/* end stackObjectValue: */;
+	if (!GIV(primFailCode)) {
+		/* begin hashBitsOf: */
+		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
+		if (hash1 == 0) {
+
+			/* would like to assert
+			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
+			   but instance-specific behaviors that are instances of themselves may
+			   fail this test. */
+
+			hash1 = (newObjectHash()) & 0x3FFFFF;
+			/* begin setHashBitsOf:to: */
+			flag("endianness");
+			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
+			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
+		}
+		oldHash = hash1;
+		/* begin setHashBitsOf:to: */
+		flag("endianness");
+		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
+		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
+		/* begin pop:thenPushInteger: */
+		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
+		GIV(stackPointer) = sp1;
+	}
+}
+
+
 /*	Primitive. Set the OS window's label */
 
 	/* InterpreterPrimitives>>#primitiveSetWindowLabel */
@@ -27781,9 +27793,11 @@
     sqInt negative;
     sqInt ok;
     int value;
+    long value64;
 
 	if ((oop & 1)) {
 		return (oop >> 1);
+
 	}
 	if ((oop & 3) != 0) {
 		/* begin primitiveFail */

Modified: branches/Cog/nsspurstacksrc/vm/interp.c
===================================================================
--- branches/Cog/nsspurstacksrc/vm/interp.c	2015-09-11 16:29:40 UTC (rev 3433)
+++ branches/Cog/nsspurstacksrc/vm/interp.c	2015-09-14 18:14:01 UTC (rev 3434)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
    from
-	StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8
+	StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26
  */
-static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1447 uuid: 21232acb-44b6-4dc4-a345-108a56a916a8 " __DATE__ ;
+static char __buildInfo[] = "StackInterpreter VMMaker.oscog-eem.1449 uuid: d4ac7710-be23-4445-8a3c-1d95713d5f26 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -537,9 +537,9 @@
 static void primitiveSecondsClock(void);
 static void primitiveSetDisplayMode(void);
 static void primitiveSetFullScreen(void);
-static void primitiveSetIdentityHash(void);
 static void primitiveSetInterruptKey(void);
 EXPORT(sqInt) primitiveSetLogDirectory(void);
+static void primitiveSetOrHasIdentityHash(void);
 EXPORT(sqInt) primitiveSetWindowLabel(void);
 EXPORT(sqInt) primitiveSetWindowSize(void);
 static void primitiveShortAt(void);
@@ -1367,8 +1367,8 @@
 _iss usqInt freeStart;
 _iss sqInt nilObj;
 _iss StackPage * stackPage;
+_iss sqInt argumentCount;
 _iss sqInt specialObjectsOop;
-_iss sqInt argumentCount;
 _iss char * framePointer;
 _iss sqInt bytecodeSetSelector;
 _iss sqInt messageSelector;
@@ -1730,7 +1730,7 @@
 	/* 158 */ (void (*)(void))0,
 	/* 159 */ (void (*)(void))0,
 	/* 160 */ primitiveAdoptInstance,
-	/* 161 */ primitiveSetIdentityHash,
+	/* 161 */ primitiveSetOrHasIdentityHash,
 	/* 162 */ (void (*)(void))0,
 	/* 163 */ (void (*)(void))0,
 	/* 164 */ (void (*)(void))0,
@@ -2147,7 +2147,7 @@
 	/* 575 */ (void (*)(void))0,
  0 };
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1447";
+const char *interpreterVersion = "Newspeak Virtual Machine StackInterpreterPrimitives_VMMaker.oscog-eem.1449";
 volatile int sendTrace;
 sqInt suppressHeartbeatFlag;
 
@@ -14846,7 +14846,8 @@
 
 	if ((oop & 1)) {
 		value = (oop >> 1);
-		if (value < 0) {
+		if ((value < 0)
+		 || (0)) {
 			/* begin primitiveFail */
 			if (!GIV(primFailCode)) {
 				GIV(primFailCode) = 1;
@@ -25103,74 +25104,7 @@
 	}
 }
 
-	/* InterpreterPrimitives>>#primitiveSetIdentityHash */
-static void
-primitiveSetIdentityHash(void)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt hash;
-    sqInt hash1;
-    sqInt integerPointer;
-    sqInt oldHash;
-    sqInt oop;
-    char *sp;
-    sqInt thisReceiver;
 
-	/* begin stackIntegerValue: */
-	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
-	/* begin checkedIntegerValueOf: */
-	if ((integerPointer & 1)) {
-		hash = (integerPointer >> 1);
-		goto l1;
-	}
-	else {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		hash = 0;
-		goto l1;
-	}
-l1:	/* end stackIntegerValue: */;
-	/* begin stackObjectValue: */
-	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
-	if ((oop & 3) != 0) {
-		/* begin primitiveFail */
-		if (!GIV(primFailCode)) {
-			GIV(primFailCode) = 1;
-		}
-		thisReceiver = null;
-		goto l2;
-	}
-	thisReceiver = oop;
-l2:	/* end stackObjectValue: */;
-	if (!GIV(primFailCode)) {
-		/* begin hashBitsOf: */
-		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
-		if (hash1 == 0) {
-
-			/* would like to assert
-			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
-			   but instance-specific behaviors that are instances of themselves may
-			   fail this test. */
-
-			hash1 = (newObjectHash()) & 0x3FFFFF;
-			/* begin setHashBitsOf:to: */
-			flag("endianness");
-			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
-			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash1);
-		}
-		oldHash = hash1;
-		/* begin setHashBitsOf:to: */
-		flag("endianness");
-		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
-		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | 0x3FFFFF) - 0x3FFFFF)) + hash);
-		/* begin pop:thenPushInteger: */
-		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((oldHash << 1) | 1));
-		GIV(stackPointer) = sp;
-	}
-}
-
-
 /*	Set the user interrupt keycode. The keycode is an integer whose encoding
 	is described in the comment for primitiveKbdNext.
  */
@@ -25273,7 +25207,85 @@
 	}
 }
 
+	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
+static void
+primitiveSetOrHasIdentityHash(void)
+{   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt hasHash;
+    sqInt hash;
+    sqInt hash1;
+    sqInt integerPointer;
+    sqInt oldHash;
+    sqInt oop;
+    char *sp;
+    char *sp1;
+    sqInt thisReceiver;
 
+	if (GIV(argumentCount) == 0) {
+		hasHash = (((longAt(GIV(stackPointer))) & 3) == 0)
+		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & 0x3FFFFF);
+		/* begin pop:thenPushBool: */
+		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
+			? GIV(trueObj)
+			: GIV(falseObj)));
+		GIV(stackPointer) = sp;
+	}
+	/* begin stackIntegerValue: */
+	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
+	/* begin checkedIntegerValueOf: */
+	if ((integerPointer & 1)) {
+		hash = (integerPointer >> 1);
+		goto l1;
+	}
+	else {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		hash = 0;
+		goto l1;
+	}
+l1:	/* end stackIntegerValue: */;
+	/* begin stackObjectValue: */
+	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
+	if ((oop & 3) != 0) {
+		/* begin primitiveFail */
+		if (!GIV(primFailCode)) {
+			GIV(primFailCode) = 1;
+		}
+		thisReceiver = null;
+		goto l2;
+	}
+	thisReceiver = oop;
+l2:	/* end stackObjectValue: */;
+	if (!GIV(primFailCode)) {
+		/* begin hashBitsOf: */
+		hash1 = (long32At(thisReceiver + 4)) & 0x3FFFFF;
+		if (hash1 == 0) {
+
+			/* would like to assert
+			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
+			   but instance-specific behaviors that are instances of themselves may
+			   fail this test. */
+
+			hash1 = (newObjectHash()) & 0x3FFFFF;
+			/* begin setHashBitsOf:to: */
+			flag("endianness");
+			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list