[Vm-dev] [commit][3301] CogVM source as per VMMaker.oscog-eem.1151

commits at squeakvm.org commits at squeakvm.org
Thu Apr 2 16:42:52 UTC 2015


Revision: 3301
Author:   eliot
Date:     2015-04-02 09:42:51 -0700 (Thu, 02 Apr 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1151

Include the directedSuperclassSend shared case in the right bytecode.

Fix sqWin32Backtrace.c compilation; on Newspeak it must now include
nsmethodcache.h.

Modified Paths:
--------------
    branches/Cog/platforms/win32/vm/sqWin32Backtrace.c
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c

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


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed Apr  1 16:04:13 PDT 2015
   + Thu Apr  2 09:42:33 PDT 2015

Modified: branches/Cog/platforms/win32/vm/sqWin32Backtrace.c
===================================================================
--- branches/Cog/platforms/win32/vm/sqWin32Backtrace.c	2015-04-01 23:03:46 UTC (rev 3300)
+++ branches/Cog/platforms/win32/vm/sqWin32Backtrace.c	2015-04-02 16:42:51 UTC (rev 3301)
@@ -27,6 +27,9 @@
 #include "sqWin32.h"
 #if COGVM
 # include "cogmethod.h"
+# if NewspeakVM
+#	include "nssendcache.h"
+# endif
 # include "cogit.h"
 #endif
 

Modified: branches/Cog/spursistasrc/vm/cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.c	2015-04-01 23:03:46 UTC (rev 3300)
+++ branches/Cog/spursistasrc/vm/cointerp.c	2015-04-02 16:42:51 UTC (rev 3301)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238
    from
-	CoInterpreter VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2
+	CoInterpreter VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1176,7 +1176,7 @@
 static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms;
 sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
 sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-sqInt stringForCString(const char *aCString);
+usqInt stringForCString(const char *aCString);
 static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
 static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
 void tenuringIncrementalGC(void);
@@ -2368,7 +2368,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1147]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1151]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -6984,7 +6984,7 @@
 				sqInt objOop2;
 				sqInt prim;
 				sqInt rcvr;
-				sqInt result;
+				usqInt result;
 				sqInt result1;
 				sqInt result2;
 				sqLong result64;
@@ -7039,9 +7039,9 @@
 						flag("endianness");
 						assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
 						numSlots = byteAt(objOop + 7);
-						result = ((usqInt) ((numSlots == 0xFF
-	? longAt(objOop - BaseHeaderSize)
-	: numSlots)));
+						result = (numSlots == 0xFF
+							? longAt(objOop - BaseHeaderSize)
+							: numSlots);
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
 					case 2:
@@ -7064,18 +7064,18 @@
 
 							/* bytes (the common case), including CompiledMethod */
 
-							result = numBytes - (fmt & 7);
+							result = ((sqInt) (numBytes - (fmt & 7)));
 							goto l11;
 						}
 						if (fmt <= 9) {
-							result = numBytes;
+							result = ((sqInt) numBytes);
 							goto l11;
 						}
 						if (fmt >= 12) {
-							result = numBytes - ((fmt & 3) << 1);
+							result = ((sqInt) (numBytes - ((fmt & 3) << 1)));
 							goto l11;
 						}
-						result = numBytes - ((fmt & 1) << 2);
+						result = ((sqInt) (numBytes - ((fmt & 1) << 2)));
 						l11:	/* end numBytesOf: */;
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
@@ -13304,7 +13304,7 @@
 				if (extB >= 64) {
 					GIV(argumentCount) = (byte & 7) + (extB << 3);
 					extB = 0;
-					goto directedSuperclassSend;
+					/* goto directedSuperclassSend */
 					goto l210;
 				}
 
@@ -13313,6 +13313,92 @@
 				goto superclassSend;
 			}
 		l210:	/* end case */;
+			
+		directedSuperclassSend:
+			/* directedSuperclassSend */
+			{
+				sqInt aValue;
+				sqInt class;
+				sqInt err;
+				sqInt err1;
+				sqInt hash;
+				sqInt hash1;
+				sqInt objOop;
+				sqInt objOop1;
+				sqInt referent;
+				sqInt referent1;
+				sqInt superclass;
+				sqInt top;
+
+				VM_LABEL(directedSuperclassSend);
+				/* begin internalPopStack */
+				top = longAt(localSP);
+				localSP += BytesPerOop;
+				class = top;
+				if (((longAt(class)) & (0x3FFFFF - 8)) == 0) {
+					/* begin followForwarded: */
+					assert(isUnambiguouslyForwarder(class));
+					referent = longAt((class + BaseHeaderSize) + (0 << (shiftForWord())));
+					while (((referent & 3) == 0)
+					 && (((longAt(referent)) & 0x3FFFFF) == 8)) {
+						referent = longAt((referent + BaseHeaderSize) + (0 << (shiftForWord())));
+					}
+					class = referent;
+				}
+				/* begin followField:ofObject: */
+				objOop = longAt((class + BaseHeaderSize) + (SuperclassIndex << (shiftForWord())));
+				if (((objOop & 3) == 0)
+				 && (((longAt(objOop)) & 0x3FFFFF) == 8)) {
+					objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, class, objOop);
+				}
+				superclass = objOop;
+				/* begin ensureBehaviorHash: */
+				assert(addressCouldBeClassObj(superclass));
+				if (((hash = (long32At(superclass + 4)) & 0x3FFFFF)) != 0) {
+					hash;
+				}
+				else {
+					if (objCouldBeClassObj(superclass)) {
+						if (((err = enterIntoClassTable(superclass))) != 0) {
+							-err;
+						}
+						else {
+							(long32At(superclass + 4)) & 0x3FFFFF;
+						}
+					}
+					else {
+						-PrimErrBadReceiver;
+					}
+				}
+				/* begin classTagForClass: */
+				assert(addressCouldBeClassObj(superclass));
+				/* begin ensureBehaviorHash: */
+				assert(addressCouldBeClassObj(superclass));
+				lkupClassTag = (((hash1 = (long32At(superclass + 4)) & 0x3FFFFF)) != 0
+					? hash1
+					: (objCouldBeClassObj(superclass)
+							? (((err1 = enterIntoClassTable(superclass))) != 0
+									? -err1
+									: (long32At(superclass + 4)) & 0x3FFFFF)
+							: -PrimErrBadReceiver));
+				/* begin ensureReceiverUnforwarded */
+				if ((((longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))) & 3) == 0)
+				 && (((longAt(longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)))) & 0x3FFFFF) == 8)) {
+					/* begin internalStackValue:put: */
+					/* begin followForwarded: */
+					objOop1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
+					assert(isUnambiguouslyForwarder(objOop1));
+					referent1 = longAt((objOop1 + BaseHeaderSize) + (0 << (shiftForWord())));
+					while (((referent1 & 3) == 0)
+					 && (((longAt(referent1)) & 0x3FFFFF) == 8)) {
+						referent1 = longAt((referent1 + BaseHeaderSize) + (0 << (shiftForWord())));
+					}
+					aValue = referent1;
+					longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue);
+				}
+				assert(lkupClassTag != (nilObject()));
+				goto commonSend;
+			}
 			break;
 		case 492: /*236*/
 			/* extTrapIfNotInstanceOfBehaviorsBytecode */
@@ -13962,7 +14048,7 @@
 				sqInt objOop2;
 				sqInt prim;
 				sqInt rcvr;
-				sqInt result;
+				usqInt result;
 				sqInt result1;
 				sqInt result2;
 				sqLong result64;
@@ -14017,9 +14103,9 @@
 						flag("endianness");
 						assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
 						numSlots = byteAt(objOop + 7);
-						result = ((usqInt) ((numSlots == 0xFF
-	? longAt(objOop - BaseHeaderSize)
-	: numSlots)));
+						result = (numSlots == 0xFF
+							? longAt(objOop - BaseHeaderSize)
+							: numSlots);
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
 					case 2:
@@ -14042,18 +14128,18 @@
 
 							/* bytes (the common case), including CompiledMethod */
 
-							result = numBytes - (fmt & 7);
+							result = ((sqInt) (numBytes - (fmt & 7)));
 							goto l218;
 						}
 						if (fmt <= 9) {
-							result = numBytes;
+							result = ((sqInt) numBytes);
 							goto l218;
 						}
 						if (fmt >= 12) {
-							result = numBytes - ((fmt & 3) << 1);
+							result = ((sqInt) (numBytes - ((fmt & 3) << 1)));
 							goto l218;
 						}
-						result = numBytes - ((fmt & 1) << 2);
+						result = ((sqInt) (numBytes - ((fmt & 1) << 2)));
 						l218:	/* end numBytesOf: */;
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
@@ -22478,7 +22564,7 @@
     int index;
     sqInt methodField;
     usqInt numArgs;
-    usqInt numTemps;
+    sqInt numTemps;
     char *rcvrAddress;
     sqInt rcvrOrClosure;
     sqInt theMethod;
@@ -28843,8 +28929,8 @@
     sqInt totalLength1;
     sqInt value;
     sqInt value1;
-    usqInt valueToStore;
-    usqInt valueToStore1;
+    sqInt valueToStore;
+    sqInt valueToStore1;
 
 	/* begin commonAtPut: */
 	value = longAt(GIV(stackPointer));
@@ -30146,7 +30232,7 @@
 				GIV(needGCFlag) = 1;
 				forceInterruptCheck();
 			}
-			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+			s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex)));
 			goto l1;
 		}
 		if (numSlots >= 0xFF) {
@@ -31462,7 +31548,7 @@
     sqInt arg;
     sqInt fmt;
     sqInt i;
-    usqInt length;
+    sqInt length;
     usqInt numBytes;
     usqInt numSlots;
     usqInt numSlots1;
@@ -31503,18 +31589,18 @@
 
 			/* bytes (the common case), including CompiledMethod */
 
-			length = ((sqInt) (numBytes - (fmt & 7)));
+			length = numBytes - (fmt & 7);
 			goto l1;
 		}
 		if (fmt <= 9) {
-			length = ((sqInt) numBytes);
+			length = numBytes;
 			goto l1;
 		}
 		if (fmt >= 12) {
-			length = ((sqInt) (numBytes - ((fmt & 3) << 1)));
+			length = numBytes - ((fmt & 3) << 1);
 			goto l1;
 		}
-		length = ((sqInt) (numBytes - ((fmt & 1) << 2)));
+		length = numBytes - ((fmt & 1) << 2);
 	l1:	/* end numBytesOf: */;
 		if (!((((((usqInt) (longAt(rcvr))) >> 24) & 0x1F) == ((((usqInt) (longAt(arg))) >> 24) & 0x1F))
 			 && (length == (numBytesOf(arg))))) {
@@ -31532,9 +31618,9 @@
 		flag("endianness");
 		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
 		numSlots1 = byteAt(rcvr + 7);
-		length = (numSlots1 == 0xFF
-			? longAt(rcvr - BaseHeaderSize)
-			: numSlots1);
+		length = ((usqInt) ((numSlots1 == 0xFF
+	? longAt(rcvr - BaseHeaderSize)
+	: numSlots1)));
 		if (!((isAppropriateForCopyObject(arg))
 			 && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> 24) & 0x1F))))) {
 			(GIV(primFailCode) = PrimErrBadArgument);
@@ -35535,7 +35621,7 @@
     sqInt err;
     sqInt hash;
     sqInt instSpec;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     sqInt numSlots;
@@ -35650,7 +35736,7 @@
     sqInt i;
     sqInt instSpec;
     sqInt literalCount;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     sqInt numSlots;
@@ -38857,8 +38943,8 @@
     sqInt totalLength1;
     sqInt value;
     sqInt value1;
-    usqInt valueToStore;
-    usqInt valueToStore1;
+    sqInt valueToStore;
+    sqInt valueToStore1;
 
 	/* begin commonAtPut: */
 	value = longAt(GIV(stackPointer));
@@ -41431,7 +41517,7 @@
     sqInt fillValue;
     sqInt hash;
     sqInt instSpec;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     usqInt numSlots;
@@ -43324,7 +43410,7 @@
     sqInt entry;
     sqInt expectedIndex;
     sqInt expectedIndex1;
-    sqInt freeChunk;
+    usqInt freeChunk;
     sqInt i;
     sqInt i1;
     sqInt index;
@@ -43363,8 +43449,8 @@
     sqInt ptr1;
     sqInt ptr2;
     sqInt slotBytes;
-    sqInt smallObj;
-    sqInt start;
+    usqInt smallObj;
+    usqInt start;
 
 	classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
 	if (classIndex == 0) {
@@ -46241,7 +46327,7 @@
     sqInt fmt;
     sqInt hasYoung;
     sqInt i;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     usqInt numSlots;
@@ -57341,13 +57427,13 @@
     sqInt obj21;
     sqInt pigBytes;
     usqInt prevFree;
-    usqInt prevFreeChunk;
+    sqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
-    usqInt thisFreeChunk;
+    sqInt thisFreeChunk;
     sqInt usedChunk;
 
 	here = startAddress;
@@ -60572,8 +60658,8 @@
     sqInt prevPrevObj;
     sqInt prevPrevObj1;
     sqInt ptr;
-    sqInt savedInHashes;
-    sqInt savedOutHashes;
+    usqInt savedInHashes;
+    usqInt savedOutHashes;
     sqInt segAddr;
     sqInt segStart;
     sqInt slotBytes;
@@ -61040,13 +61126,13 @@
 /*	Answer a new String copied from a null-terminated C string,
 	or nil if out of memory. */
 
-sqInt
+usqInt
 stringForCString(const char *aCString)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt formatField;
     sqInt len;
     usqInt newObj;
-    sqInt newString;
+    usqInt newString;
     usqInt numBytes;
     sqInt numSlots;
 
@@ -73494,7 +73580,7 @@
     sqInt sp1;
     sqInt stSize;
     sqInt totalLength;
-    usqInt valueToStore;
+    sqInt valueToStore;
 
 	hdr = long64At(array);
 	fmt = (((unsigned sqLong)hdr) >> 24) & 0x1F;
@@ -74757,8 +74843,8 @@
     sqInt totalLength;
     sqInt totalLength1;
     sqInt value;
-    usqInt valueToStore;
-    usqInt valueToStore1;
+    sqInt valueToStore;
+    sqInt valueToStore1;
 
 	value = longAt(GIV(stackPointer));
 	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -76530,7 +76616,7 @@
     sqInt rcvr;
     char *sp;
     sqInt totalLength;
-    usqInt valueToStore;
+    sqInt valueToStore;
 
 	newValue = longAt(GIV(stackPointer));
 	/* begin stackIntegerValue: */
@@ -76765,7 +76851,7 @@
     sqInt header1;
     sqInt i;
     sqInt methodHeader;
-    sqInt numSlots;
+    usqInt numSlots;
     usqInt numSlots1;
     sqInt rcvr;
     char *sp;
@@ -76821,9 +76907,9 @@
 			flag("endianness");
 			assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
 			numSlots1 = byteAt(rcvr + 7);
-			numSlots = ((usqInt) ((numSlots1 == 0xFF
-	? longAt(rcvr - BaseHeaderSize)
-	: numSlots1)));
+			numSlots = (numSlots1 == 0xFF
+				? longAt(rcvr - BaseHeaderSize)
+				: numSlots1);
 		}
 	}
 	else {

Modified: branches/Cog/spursistasrc/vm/cointerp.h
===================================================================
--- branches/Cog/spursistasrc/vm/cointerp.h	2015-04-01 23:03:46 UTC (rev 3300)
+++ branches/Cog/spursistasrc/vm/cointerp.h	2015-04-02 16:42:51 UTC (rev 3301)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238
  */
 
 
@@ -252,7 +252,7 @@
 sqInt splObj(sqInt index);
 usqInt storeCheckBoundary(void);
 sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-sqInt stringForCString(const char *aCString);
+usqInt stringForCString(const char *aCString);
 void tenuringIncrementalGC(void);
 sqInt topRemappableOop(void);
 sqInt validFreeTree(void);

Modified: branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/spursistasrc/vm/gcc3x-cointerp.c	2015-04-01 23:03:46 UTC (rev 3300)
+++ branches/Cog/spursistasrc/vm/gcc3x-cointerp.c	2015-04-02 16:42:51 UTC (rev 3301)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238
    from
-	CoInterpreter VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2
+	CoInterpreter VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1147 uuid: 0fd3920d-c904-484f-b436-e6563dce31c2 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1151 uuid: 4356fa11-234c-40ba-b3cc-fc9797b15238 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -1179,7 +1179,7 @@
 static sqInt storeImageSegmentIntooutPointersroots(sqInt segmentWordArray, sqInt outPointerArray, sqInt arrayOfRoots) NoDbgRegParms;
 sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
 sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
-sqInt stringForCString(const char *aCString);
+usqInt stringForCString(const char *aCString);
 static sqInt sufficientSpaceAfterGC(sqInt numBytes) NoDbgRegParms;
 static sqInt swizzleObjStackAt(sqInt objStackRootIndex) NoDbgRegParms;
 void tenuringIncrementalGC(void);
@@ -2371,7 +2371,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1147]";
+const char *interpreterVersion = "Croquet Closure Cog VM [CoInterpreterPrimitives VMMaker.oscog-eem.1151]";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -6993,7 +6993,7 @@
 				sqInt objOop2;
 				sqInt prim;
 				sqInt rcvr;
-				sqInt result;
+				usqInt result;
 				sqInt result1;
 				sqInt result2;
 				sqLong result64;
@@ -7048,9 +7048,9 @@
 						flag("endianness");
 						assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
 						numSlots = byteAt(objOop + 7);
-						result = ((usqInt) ((numSlots == 0xFF
-	? longAt(objOop - BaseHeaderSize)
-	: numSlots)));
+						result = (numSlots == 0xFF
+							? longAt(objOop - BaseHeaderSize)
+							: numSlots);
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
 					case 2:
@@ -7073,18 +7073,18 @@
 
 							/* bytes (the common case), including CompiledMethod */
 
-							result = numBytes - (fmt & 7);
+							result = ((sqInt) (numBytes - (fmt & 7)));
 							goto l11;
 						}
 						if (fmt <= 9) {
-							result = numBytes;
+							result = ((sqInt) numBytes);
 							goto l11;
 						}
 						if (fmt >= 12) {
-							result = numBytes - ((fmt & 3) << 1);
+							result = ((sqInt) (numBytes - ((fmt & 3) << 1)));
 							goto l11;
 						}
-						result = numBytes - ((fmt & 1) << 2);
+						result = ((sqInt) (numBytes - ((fmt & 1) << 2)));
 						l11:	/* end numBytesOf: */;
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
@@ -13313,7 +13313,7 @@
 				if (extB >= 64) {
 					GIV(argumentCount) = (byte & 7) + (extB << 3);
 					extB = 0;
-					goto directedSuperclassSend;
+					/* goto directedSuperclassSend */
 					goto l210;
 				}
 
@@ -13322,6 +13322,92 @@
 				goto superclassSend;
 			}
 		l210:	/* end case */;
+			
+		directedSuperclassSend:
+			/* directedSuperclassSend */
+			{
+				sqInt aValue;
+				sqInt class;
+				sqInt err;
+				sqInt err1;
+				sqInt hash;
+				sqInt hash1;
+				sqInt objOop;
+				sqInt objOop1;
+				sqInt referent;
+				sqInt referent1;
+				sqInt superclass;
+				sqInt top;
+
+				VM_LABEL(directedSuperclassSend);
+				/* begin internalPopStack */
+				top = longAt(localSP);
+				localSP += BytesPerOop;
+				class = top;
+				if (((longAt(class)) & (0x3FFFFF - 8)) == 0) {
+					/* begin followForwarded: */
+					assert(isUnambiguouslyForwarder(class));
+					referent = longAt((class + BaseHeaderSize) + (0 << (shiftForWord())));
+					while (((referent & 3) == 0)
+					 && (((longAt(referent)) & 0x3FFFFF) == 8)) {
+						referent = longAt((referent + BaseHeaderSize) + (0 << (shiftForWord())));
+					}
+					class = referent;
+				}
+				/* begin followField:ofObject: */
+				objOop = longAt((class + BaseHeaderSize) + (SuperclassIndex << (shiftForWord())));
+				if (((objOop & 3) == 0)
+				 && (((longAt(objOop)) & 0x3FFFFF) == 8)) {
+					objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, class, objOop);
+				}
+				superclass = objOop;
+				/* begin ensureBehaviorHash: */
+				assert(addressCouldBeClassObj(superclass));
+				if (((hash = (long32At(superclass + 4)) & 0x3FFFFF)) != 0) {
+					hash;
+				}
+				else {
+					if (objCouldBeClassObj(superclass)) {
+						if (((err = enterIntoClassTable(superclass))) != 0) {
+							-err;
+						}
+						else {
+							(long32At(superclass + 4)) & 0x3FFFFF;
+						}
+					}
+					else {
+						-PrimErrBadReceiver;
+					}
+				}
+				/* begin classTagForClass: */
+				assert(addressCouldBeClassObj(superclass));
+				/* begin ensureBehaviorHash: */
+				assert(addressCouldBeClassObj(superclass));
+				lkupClassTag = (((hash1 = (long32At(superclass + 4)) & 0x3FFFFF)) != 0
+					? hash1
+					: (objCouldBeClassObj(superclass)
+							? (((err1 = enterIntoClassTable(superclass))) != 0
+									? -err1
+									: (long32At(superclass + 4)) & 0x3FFFFF)
+							: -PrimErrBadReceiver));
+				/* begin ensureReceiverUnforwarded */
+				if ((((longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))) & 3) == 0)
+				 && (((longAt(longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)))) & 0x3FFFFF) == 8)) {
+					/* begin internalStackValue:put: */
+					/* begin followForwarded: */
+					objOop1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
+					assert(isUnambiguouslyForwarder(objOop1));
+					referent1 = longAt((objOop1 + BaseHeaderSize) + (0 << (shiftForWord())));
+					while (((referent1 & 3) == 0)
+					 && (((longAt(referent1)) & 0x3FFFFF) == 8)) {
+						referent1 = longAt((referent1 + BaseHeaderSize) + (0 << (shiftForWord())));
+					}
+					aValue = referent1;
+					longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue);
+				}
+				assert(lkupClassTag != (nilObject()));
+				goto commonSend;
+			}
 			BREAK;
 		CASE(492) /*236*/
 			/* extTrapIfNotInstanceOfBehaviorsBytecode */
@@ -13971,7 +14057,7 @@
 				sqInt objOop2;
 				sqInt prim;
 				sqInt rcvr;
-				sqInt result;
+				usqInt result;
 				sqInt result1;
 				sqInt result2;
 				sqLong result64;
@@ -14026,9 +14112,9 @@
 						flag("endianness");
 						assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
 						numSlots = byteAt(objOop + 7);
-						result = ((usqInt) ((numSlots == 0xFF
-	? longAt(objOop - BaseHeaderSize)
-	: numSlots)));
+						result = (numSlots == 0xFF
+							? longAt(objOop - BaseHeaderSize)
+							: numSlots);
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
 					case 2:
@@ -14051,18 +14137,18 @@
 
 							/* bytes (the common case), including CompiledMethod */
 
-							result = numBytes - (fmt & 7);
+							result = ((sqInt) (numBytes - (fmt & 7)));
 							goto l218;
 						}
 						if (fmt <= 9) {
-							result = numBytes;
+							result = ((sqInt) numBytes);
 							goto l218;
 						}
 						if (fmt >= 12) {
-							result = numBytes - ((fmt & 3) << 1);
+							result = ((sqInt) (numBytes - ((fmt & 3) << 1)));
 							goto l218;
 						}
-						result = numBytes - ((fmt & 1) << 2);
+						result = ((sqInt) (numBytes - ((fmt & 1) << 2)));
 						l218:	/* end numBytesOf: */;
 						longAtPointerput(localSP, ((result << 1) | 1));
 						break;
@@ -22487,7 +22573,7 @@
     int index;
     sqInt methodField;
     usqInt numArgs;
-    usqInt numTemps;
+    sqInt numTemps;
     char *rcvrAddress;
     sqInt rcvrOrClosure;
     sqInt theMethod;
@@ -28852,8 +28938,8 @@
     sqInt totalLength1;
     sqInt value;
     sqInt value1;
-    usqInt valueToStore;
-    usqInt valueToStore1;
+    sqInt valueToStore;
+    sqInt valueToStore1;
 
 	/* begin commonAtPut: */
 	value = longAt(GIV(stackPointer));
@@ -30155,7 +30241,7 @@
 				GIV(needGCFlag) = 1;
 				forceInterruptCheck();
 			}
-			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
+			s = ((usqInt) (allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex)));
 			goto l1;
 		}
 		if (numSlots >= 0xFF) {
@@ -31471,7 +31557,7 @@
     sqInt arg;
     sqInt fmt;
     sqInt i;
-    usqInt length;
+    sqInt length;
     usqInt numBytes;
     usqInt numSlots;
     usqInt numSlots1;
@@ -31512,18 +31598,18 @@
 
 			/* bytes (the common case), including CompiledMethod */
 
-			length = ((sqInt) (numBytes - (fmt & 7)));
+			length = numBytes - (fmt & 7);
 			goto l1;
 		}
 		if (fmt <= 9) {
-			length = ((sqInt) numBytes);
+			length = numBytes;
 			goto l1;
 		}
 		if (fmt >= 12) {
-			length = ((sqInt) (numBytes - ((fmt & 3) << 1)));
+			length = numBytes - ((fmt & 3) << 1);
 			goto l1;
 		}
-		length = ((sqInt) (numBytes - ((fmt & 1) << 2)));
+		length = numBytes - ((fmt & 1) << 2);
 	l1:	/* end numBytesOf: */;
 		if (!((((((usqInt) (longAt(rcvr))) >> 24) & 0x1F) == ((((usqInt) (longAt(arg))) >> 24) & 0x1F))
 			 && (length == (numBytesOf(arg))))) {
@@ -31541,9 +31627,9 @@
 		flag("endianness");
 		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
 		numSlots1 = byteAt(rcvr + 7);
-		length = (numSlots1 == 0xFF
-			? longAt(rcvr - BaseHeaderSize)
-			: numSlots1);
+		length = ((usqInt) ((numSlots1 == 0xFF
+	? longAt(rcvr - BaseHeaderSize)
+	: numSlots1)));
 		if (!((isAppropriateForCopyObject(arg))
 			 && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> 24) & 0x1F))))) {
 			(GIV(primFailCode) = PrimErrBadArgument);
@@ -35544,7 +35630,7 @@
     sqInt err;
     sqInt hash;
     sqInt instSpec;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     sqInt numSlots;
@@ -35659,7 +35745,7 @@
     sqInt i;
     sqInt instSpec;
     sqInt literalCount;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     sqInt numSlots;
@@ -38866,8 +38952,8 @@
     sqInt totalLength1;
     sqInt value;
     sqInt value1;
-    usqInt valueToStore;
-    usqInt valueToStore1;
+    sqInt valueToStore;
+    sqInt valueToStore1;
 
 	/* begin commonAtPut: */
 	value = longAt(GIV(stackPointer));
@@ -41440,7 +41526,7 @@
     sqInt fillValue;
     sqInt hash;
     sqInt instSpec;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     usqInt numSlots;
@@ -43333,7 +43419,7 @@
     sqInt entry;
     sqInt expectedIndex;
     sqInt expectedIndex1;
-    sqInt freeChunk;
+    usqInt freeChunk;
     sqInt i;
     sqInt i1;
     sqInt index;
@@ -43372,8 +43458,8 @@
     sqInt ptr1;
     sqInt ptr2;
     sqInt slotBytes;
-    sqInt smallObj;
-    sqInt start;
+    usqInt smallObj;
+    usqInt start;
 
 	classIndex = (long32At(aClass + 4)) & 0x3FFFFF;
 	if (classIndex == 0) {
@@ -46250,7 +46336,7 @@
     sqInt fmt;
     sqInt hasYoung;
     sqInt i;
-    sqInt newObj;
+    usqInt newObj;
     usqInt newObj1;
     usqInt numBytes;
     usqInt numSlots;
@@ -57350,13 +57436,13 @@
     sqInt obj21;
     sqInt pigBytes;
     usqInt prevFree;
-    usqInt prevFreeChunk;
+    sqInt prevFreeChunk;
     usqInt prevPrevFree;
-    usqInt prevPrevFreeChunk;
+    sqInt prevPrevFreeChunk;
     sqInt slotBytes;
     sqInt slotBytes1;
     usqInt there;
-    usqInt thisFreeChunk;
+    sqInt thisFreeChunk;
     sqInt usedChunk;
 
 	here = startAddress;
@@ -60581,8 +60667,8 @@
     sqInt prevPrevObj;
     sqInt prevPrevObj1;
     sqInt ptr;
-    sqInt savedInHashes;
-    sqInt savedOutHashes;
+    usqInt savedInHashes;
+    usqInt savedOutHashes;
     sqInt segAddr;
     sqInt segStart;
     sqInt slotBytes;
@@ -61049,13 +61135,13 @@
 /*	Answer a new String copied from a null-terminated C string,
 	or nil if out of memory. */
 
-sqInt
+usqInt
 stringForCString(const char *aCString)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt formatField;
     sqInt len;
     usqInt newObj;
-    sqInt newString;
+    usqInt newString;
     usqInt numBytes;
     sqInt numSlots;
 
@@ -73503,7 +73589,7 @@
     sqInt sp1;
     sqInt stSize;
     sqInt totalLength;
-    usqInt valueToStore;
+    sqInt valueToStore;
 
 	hdr = long64At(array);
 	fmt = (((unsigned sqLong)hdr) >> 24) & 0x1F;
@@ -74766,8 +74852,8 @@
     sqInt totalLength;
     sqInt totalLength1;
     sqInt value;
-    usqInt valueToStore;
-    usqInt valueToStore1;
+    sqInt valueToStore;
+    sqInt valueToStore1;
 
 	value = longAt(GIV(stackPointer));
 	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
@@ -76539,7 +76625,7 @@
     sqInt rcvr;
     char *sp;
     sqInt totalLength;
-    usqInt valueToStore;
+    sqInt valueToStore;
 
 	newValue = longAt(GIV(stackPointer));
 	/* begin stackIntegerValue: */
@@ -76774,7 +76860,7 @@
     sqInt header1;
     sqInt i;
     sqInt methodHeader;
-    sqInt numSlots;
+    usqInt numSlots;
     usqInt numSlots1;
     sqInt rcvr;
     char *sp;
@@ -76830,9 +76916,9 @@
 			flag("endianness");
 			assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
 			numSlots1 = byteAt(rcvr + 7);
-			numSlots = ((usqInt) ((numSlots1 == 0xFF
-	? longAt(rcvr - BaseHeaderSize)
-	: numSlots1)));
+			numSlots = (numSlots1 == 0xFF
+				? longAt(rcvr - BaseHeaderSize)
+				: numSlots1);
 		}
 	}
 	else {



More information about the Vm-dev mailing list