[Vm-dev] [commit][3402] CogVM source as per VMMaker.oscog-eem.1409

commits at squeakvm.org commits at squeakvm.org
Fri Jul 10 21:17:10 UTC 2015


Revision: 3402
Author:   eliot
Date:     2015-07-10 14:17:09 -0700 (Fri, 10 Jul 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1409

Integrate Ryan's code for ARM call-out and callback support in the Alien plugin.

Fix slangification of ThreadedFFIPlugin.  Eliminate a few warnings there-in.

Make type of tenuringIncrementalGC agree with sqVirtualMachine.h.

Provide a back door for the ARM division routines during simulation.

Type FFI support routines ioLoadModuleOfLength & ioLoadSymbolOfLengthFromModule
correctly in sqVirtualMachine.h.

Make the Spur image upload script also upload the 64-bit image if it is newer
than the 32-bit one.

Modified Paths:
--------------
    branches/Cog/image/uploadspurimage.sh
    branches/Cog/platforms/Cross/vm/sqVirtualMachine.c
    branches/Cog/platforms/Cross/vm/sqVirtualMachine.h
    branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c
    branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c

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

Modified: branches/Cog/image/uploadspurimage.sh
===================================================================
--- branches/Cog/image/uploadspurimage.sh	2015-07-09 21:08:58 UTC (rev 3401)
+++ branches/Cog/image/uploadspurimage.sh	2015-07-10 21:17:09 UTC (rev 3402)
@@ -8,7 +8,7 @@
 BASENAME=trunk46-spur
 
 test "$1" = -here || cd `dirname $0`
-echo uploading trunk46-spur from `pwd`
+echo uploading $BASENAME from `pwd`
 cksum $BASENAME.[ci]* >$BASENAME.sum
 
 DIR=$RemoteRoot/$DATE
@@ -18,8 +18,22 @@
 scp -p $BASENAME.image $BASENAME.changes $BASENAME.sum "$@" $RemoteUser:$DIR
 echo ssh $RemoteUser chmod a-w $DIR/* \\\; ls -al $DIR
 ssh $RemoteUser chmod a-w $DIR/* \; ls -al $DIR
-echo ssh $RemoteUser rm $RemoteRoot/{$BASENAME.image,$BASENAME.changes,$BASENAME.sum}
-ssh $RemoteUser rm $RemoteRoot/{$BASENAME.image,$BASENAME.changes,$BASENAME.sum}
+echo ssh $RemoteUser rm -f \
+	$RemoteRoot/{$BASENAME.image,$BASENAME.changes,$BASENAME.sum} \
+	$RemoteRoot/{$BASENAME-64.image,$BASENAME-64.changes,$BASENAME-64.sum}
+ssh $RemoteUser rm -f \
+	$RemoteRoot/{$BASENAME.image,$BASENAME.changes,$BASENAME.sum} \
+	$RemoteRoot/{$BASENAME-64.image,$BASENAME-64.changes,$BASENAME-64.sum}
 echo ssh $RemoteUser cd $RemoteRoot \\\; ln -s $DATE/{$BASENAME.image,$BASENAME.changes} .
 ssh $RemoteUser cd $RemoteRoot \; ln -s $DATE/{$BASENAME.image,$BASENAME.changes,$BASENAME.sum} .
+
+if [ "$BASENAME-64.changes" -nt "$BASENAME.changes" \
+	-a \( "$BASENAME-64.image" -nt "$BASENAME.image" ]; then
+	echo uploading $BASENAME-64 from `pwd`
+	cksum $BASENAME-64.[ci]* >$BASENAME-64.sum
+	echo scp -p $BASENAME-64.image $BASENAME-64.changes $BASENAME-64.sum $RemoteUser:$DIR
+	scp -p $BASENAME-64.image $BASENAME-64.changes $BASENAME-64.sum $RemoteUser:$DIR
+	echo ssh $RemoteUser cd $RemoteRoot \\\; ln -s $DATE/{$BASENAME-64.image,$BASENAME-64.changes} .
+	ssh $RemoteUser cd $RemoteRoot \; ln -s $DATE/{$BASENAME-64.image,$BASENAME-64.changes,$BASENAME-64.sum} .
+fi
 ssh $RemoteUser ls -l $RemoteRoot $RemoteRoot/$DATE


Property changes on: branches/Cog/platforms/Cross/vm/sqSCCSVersion.h
___________________________________________________________________
Modified: checkindate
   - Wed Jul  8 11:27:26 PDT 2015
   + Fri Jul 10 14:13:45 PDT 2015

Modified: branches/Cog/platforms/Cross/vm/sqVirtualMachine.c
===================================================================
--- branches/Cog/platforms/Cross/vm/sqVirtualMachine.c	2015-07-09 21:08:58 UTC (rev 3401)
+++ branches/Cog/platforms/Cross/vm/sqVirtualMachine.c	2015-07-10 21:17:09 UTC (rev 3402)
@@ -165,8 +165,8 @@
 sqInt classExternalFunction(void);
 sqInt classExternalLibrary(void);
 sqInt classExternalStructure(void);
-sqInt ioLoadModuleOfLength(sqInt moduleNameIndex, sqInt moduleNameLength);
-sqInt ioLoadSymbolOfLengthFromModule(sqInt functionNameIndex, sqInt functionNameLength, sqInt moduleHandle);
+void *ioLoadModuleOfLength(sqInt moduleNameIndex, sqInt moduleNameLength);
+void *ioLoadSymbolOfLengthFromModule(sqInt functionNameIndex, sqInt functionNameLength, sqInt moduleHandle);
 sqInt isInMemory(sqInt address);
 sqInt classAlien(void); /* Alien FFI */
 sqInt classUnsafeAlien(void); /* Alien FFI */

Modified: branches/Cog/platforms/Cross/vm/sqVirtualMachine.h
===================================================================
--- branches/Cog/platforms/Cross/vm/sqVirtualMachine.h	2015-07-09 21:08:58 UTC (rev 3401)
+++ branches/Cog/platforms/Cross/vm/sqVirtualMachine.h	2015-07-10 21:17:09 UTC (rev 3402)
@@ -202,8 +202,8 @@
 	sqInt (*classExternalFunction)(void);
 	sqInt (*classExternalLibrary)(void);
 	sqInt (*classExternalStructure)(void);
-	sqInt (*ioLoadModuleOfLength)(sqInt modIndex, sqInt modLength);
-	sqInt (*ioLoadSymbolOfLengthFromModule)(sqInt fnIndex, sqInt fnLength, sqInt handle);
+	void *(*ioLoadModuleOfLength)(sqInt modIndex, sqInt modLength);
+	void *(*ioLoadSymbolOfLengthFromModule)(sqInt fnIndex, sqInt fnLength, sqInt handle);
 	sqInt (*isInMemory)(sqInt address);
 
 #endif

Modified: branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c
===================================================================
--- branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c	2015-07-09 21:08:58 UTC (rev 3401)
+++ branches/Cog/src/plugins/SqueakFFIPrims/ARM32FFIPlugin.c	2015-07-10 21:17:09 UTC (rev 3402)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.1408 uuid: 51bc4e0f-a338-4394-8c6a-22b4b3e07c61
+	VMPluginCodeGenerator VMMaker.oscog-eem.1409 uuid: 428ff402-b7ce-44c6-a95d-5db172a1e43f
    from
-	ThreadedARMFFIPlugin VMMaker.oscog-eem.1408 uuid: 51bc4e0f-a338-4394-8c6a-22b4b3e07c61
+	ThreadedARMFFIPlugin VMMaker.oscog-eem.1409 uuid: 428ff402-b7ce-44c6-a95d-5db172a1e43f
  */
-static char __buildInfo[] = "ThreadedARMFFIPlugin VMMaker.oscog-eem.1408 uuid: 51bc4e0f-a338-4394-8c6a-22b4b3e07c61 " __DATE__ ;
+static char __buildInfo[] = "ThreadedARMFFIPlugin VMMaker.oscog-eem.1409 uuid: 428ff402-b7ce-44c6-a95d-5db172a1e43f " __DATE__ ;
 
 
 
@@ -361,7 +361,7 @@
 static sqInt (*stackValue)(sqInt offset);
 static sqInt (*storeIntegerofObjectwithValue)(sqInt index, sqInt oop, sqInt integer);
 static sqInt (*storePointerofObjectwithValue)(sqInt index, sqInt oop, sqInt valuePointer);
-static sqInt (*tenuringIncrementalGC)(void);
+static void (*tenuringIncrementalGC)(void);
 static sqInt (*trueObject)(void);
 #else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
 extern sqInt booleanValueOf(sqInt obj);
@@ -447,16 +447,16 @@
 extern sqInt stackValue(sqInt offset);
 extern sqInt storeIntegerofObjectwithValue(sqInt index, sqInt oop, sqInt integer);
 extern sqInt storePointerofObjectwithValue(sqInt index, sqInt oop, sqInt valuePointer);
-extern sqInt tenuringIncrementalGC(void);
+extern void tenuringIncrementalGC(void);
 extern sqInt trueObject(void);
 extern
 #endif
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"ARM32FFIPlugin VMMaker.oscog-eem.1408 (i)"
+	"ARM32FFIPlugin VMMaker.oscog-eem.1409 (i)"
 #else
-	"ARM32FFIPlugin VMMaker.oscog-eem.1408 (e)"
+	"ARM32FFIPlugin VMMaker.oscog-eem.1409 (e)"
 #endif
 ;
 
@@ -934,7 +934,7 @@
 			}
 			/* begin ffiPushPointer:in: */
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((void *) ptrAddress));
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)(((void *) ptrAddress))));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -958,7 +958,7 @@
 		if (oop == nilOop) {
 			/* begin ffiPushPointer:in: */
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = null;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)null));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -1066,7 +1066,7 @@
 						(calloutState->stringArgIndex = ((calloutState->stringArgIndex)) + 1);
 						/* begin ffiPushPointer:in: */
 						if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = copy;
+							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)copy));
 							(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 						}
 						else {
@@ -1108,7 +1108,7 @@
 						/* begin ffiPushPointer:in: */
 						pointer1 = ((void *) (firstIndexableField(oop)));
 						if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer1;
+							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer1));
 							(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 						}
 						else {
@@ -1126,7 +1126,7 @@
 							? (oop + BaseHeaderSize) + BytesPerOop
 							: longAt((oop + BaseHeaderSize) + BytesPerOop)));
 						if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer2;
+							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer2));
 							(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 						}
 						else {
@@ -1151,7 +1151,7 @@
 						/* begin ffiPushPointer:in: */
 						pointer3 = ((void *) (firstIndexableField(oop)));
 						if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer3;
+							((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer3));
 							(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 						}
 						else {
@@ -1382,7 +1382,7 @@
 			(calloutState->stringArgIndex = ((calloutState->stringArgIndex)) + 1);
 			/* begin ffiPushPointer:in: */
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = copy;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)copy));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -1424,7 +1424,7 @@
 			/* begin ffiPushPointer:in: */
 			pointer1 = ((void *) (firstIndexableField(oop)));
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer1;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer1));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -1442,7 +1442,7 @@
 				? (oop + BaseHeaderSize) + BytesPerOop
 				: longAt((oop + BaseHeaderSize) + BytesPerOop)));
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer2;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer2));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -1467,7 +1467,7 @@
 			/* begin ffiPushPointer:in: */
 			pointer3 = ((void *) (firstIndexableField(oop)));
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer3;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer3));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -1648,131 +1648,144 @@
 		/* Note: Order is important here since FFIFlagPointer + FFIFlagStructure is used to represent
 		   'typedef void* VoidPointer' and VoidPointer must be returned as pointer *not* as struct. */
 
-		return (((calloutState->ffiRetHeader)) & FFIFlagPointer
-			? (/* begin ffiReturnPointer:ofType:in: */
-				/* begin ffiReturnType: */
-				(specLiteral1 = (specOnStack
-						? stackValue(1)
-						: literalofMethod(0, primitiveMethod()))),
-				(argTypes1 = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral1)),
-				(retType = fetchPointerofObject(0, argTypes1)),
-				(retClass1 = fetchPointerofObject(1, retType)),
-				(retClass1 == (nilObject())
-						? (/* begin atomicTypeOf: */
-							(typeSpec1 = (calloutState->ffiRetHeader)),
-							(atomicType1 = ((usqInt) (typeSpec1 & FFIAtomicTypeMask)) >> FFIAtomicTypeShift),
-							((((usqInt) atomicType1) >> 1) == (((usqInt) FFITypeSignedChar) >> 1)
-									? (/* begin ffiReturnCStringFrom: */
-										(cPointer = ((usqInt) intRet)),
-										(cPointer == null
-												? (methodReturnValue(nilObject()),
-													goto l2)
-												: 0),
-										(cString = ((char *) cPointer)),
-										(strLen = 0),
-										while (!((cString[strLen]) == 0)) {
-												strLen += 1;
-											}
-										(strOop = instantiateClassindexableSize(classString(), strLen)),
-										(strPtr = firstIndexableField(strOop)),
-										for (i = 0; i < strLen; i += 1) {
-												strPtr[i] = (cString[i]);
-											}
-										methodReturnValue(strOop),
-										goto l2)
-									: 0),
-							
+		if (((calloutState->ffiRetHeader)) & FFIFlagPointer) {
+			/* begin ffiReturnPointer:ofType:in: */
+			/* begin ffiReturnType: */
+			specLiteral1 = (specOnStack
+				? stackValue(1)
+				: literalofMethod(0, primitiveMethod()));
+			argTypes1 = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral1);
+			retType = fetchPointerofObject(0, argTypes1);
+			retClass1 = fetchPointerofObject(1, retType);
+			if (retClass1 == (nilObject())) {
+
+				/* Create ExternalData upon return */
+
+				/* begin atomicTypeOf: */
+				typeSpec1 = (calloutState->ffiRetHeader);
+				atomicType1 = ((usqInt) (typeSpec1 & FFIAtomicTypeMask)) >> FFIAtomicTypeShift;
+				if ((((usqInt) atomicType1) >> 1) == (((usqInt) FFITypeSignedChar) >> 1)) {
+
+					/* String return */
+
+					/* begin ffiReturnCStringFrom: */
+					cPointer = ((usqInt) intRet);
+					if (cPointer == null) {
+						oop = methodReturnValue(nilObject());
+						goto l2;
+					}
+					cString = ((char *) cPointer);
+					strLen = 0;
+					while (!((cString[strLen]) == 0)) {
+						strLen += 1;
+					}
+					strOop = instantiateClassindexableSize(classString(), strLen);
+					strPtr = firstIndexableField(strOop);
+					for (i = 0; i < strLen; i += 1) {
+						strPtr[i] = (cString[i]);
+					}
+					oop = methodReturnValue(strOop);
+					goto l2;
+				}
+				
 #if SPURVM
-								oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
-								ptr = firstIndexableField(oop2);
-								ptr[0] = (((sqInt) intRet));
-								
+				oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
+				ptr = firstIndexableField(oop2);
+				ptr[0] = (((sqInt) intRet));
+				
 #if SPURVM
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
 
 #else /* SPURVM */
-								pushRemappableOop(oop2);
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
-								oop2 = popRemappableOop()
+				pushRemappableOop(oop2);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				oop2 = popRemappableOop()
 #endif /* SPURVM */
 ;
-								storePointerofObjectwithValue(0, retOop1, oop2);
+				storePointerofObjectwithValue(0, retOop1, oop2);
 
 #else /* SPURVM */
-								pushRemappableOop(retType);
-								oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
-								ptr = firstIndexableField(oop2);
-								ptr[0] = (((sqInt) intRet));
-								
+				pushRemappableOop(retType);
+				oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
+				ptr = firstIndexableField(oop2);
+				ptr[0] = (((sqInt) intRet));
+				
 #if SPURVM
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
 
 #else /* SPURVM */
-								pushRemappableOop(oop2);
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
-								oop2 = popRemappableOop()
+				pushRemappableOop(oop2);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				oop2 = popRemappableOop()
 #endif /* SPURVM */
 ;
-								storePointerofObjectwithValue(0, retOop1, oop2);
-								retType = popRemappableOop()
+				storePointerofObjectwithValue(0, retOop1, oop2);
+				retType = popRemappableOop()
 #endif /* SPURVM */
-,
-							storePointerofObjectwithValue(1, retOop1, retType),
-							methodReturnValue(retOop1),
-							goto l2)
-						: 0),
-				(classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
-						? classByteArray()
-						: classExternalAddress())),
-				
+;
+				storePointerofObjectwithValue(1, retOop1, retType);
+				oop = methodReturnValue(retOop1);
+				goto l2;
+			}
+			classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
+				? classByteArray()
+				: classExternalAddress());
+			
 #if SPURVM
-					oop2 = instantiateClassindexableSize(classOop, 4);
+			oop2 = instantiateClassindexableSize(classOop, 4);
 
 #else /* SPURVM */
-					pushRemappableOop(retClass1);
-					oop2 = instantiateClassindexableSize(classOop, 4);
-					retClass1 = popRemappableOop()
+			pushRemappableOop(retClass1);
+			oop2 = instantiateClassindexableSize(classOop, 4);
+			retClass1 = popRemappableOop()
 #endif /* SPURVM */
-,
-				(ptr = firstIndexableField(oop2)),
-				ptr[0] = (((sqInt) intRet)),
-				
+;
+			ptr = firstIndexableField(oop2);
+			ptr[0] = (((sqInt) intRet));
+			
 #if SPURVM
-					retOop1 = instantiateClassindexableSize(retClass1, 0);
+			retOop1 = instantiateClassindexableSize(retClass1, 0);
 
 #else /* SPURVM */
-					pushRemappableOop(oop2);
-					retOop1 = instantiateClassindexableSize(retClass1, 0);
-					oop2 = popRemappableOop()
+			pushRemappableOop(oop2);
+			retOop1 = instantiateClassindexableSize(retClass1, 0);
+			oop2 = popRemappableOop()
 #endif /* SPURVM */
-,
-				storePointerofObjectwithValue(0, retOop1, oop2),
-				methodReturnValue(retOop1),
-			l2:	/* end ffiReturnPointer:ofType:in: */)
-			: (/* begin ffiReturnStruct:ofType:in: */
-				/* begin ffiReturnType: */
-				(specLiteral = (specOnStack
-						? stackValue(1)
-						: literalofMethod(0, primitiveMethod()))),
-				(argTypes = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral)),
-				(ffiRetType = fetchPointerofObject(0, argTypes)),
-				(retClass = fetchPointerofObject(1, ffiRetType)),
-				(retOop = instantiateClassindexableSize(retClass, 0)),
-				
+;
+			storePointerofObjectwithValue(0, retOop1, oop2);
+			oop = methodReturnValue(retOop1);
+		l2:	/* end ffiReturnPointer:ofType:in: */;
+		}
+		else {
+			/* begin ffiReturnStruct:ofType:in: */
+			/* begin ffiReturnType: */
+			specLiteral = (specOnStack
+				? stackValue(1)
+				: literalofMethod(0, primitiveMethod()));
+			argTypes = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral);
+			ffiRetType = fetchPointerofObject(0, argTypes);
+			retClass = fetchPointerofObject(1, ffiRetType);
+			retOop = instantiateClassindexableSize(retClass, 0);
+			
 #if SPURVM
-					oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
+			oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
 
 #else /* SPURVM */
-					pushRemappableOop(retOop);
-					oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
-					retOop = popRemappableOop()
+			pushRemappableOop(retOop);
+			oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
+			retOop = popRemappableOop()
 #endif /* SPURVM */
-,
-				(returnStructInRegisters((calloutState->structReturnSize))
-						? memcpy(firstIndexableField(oop1), (&intRet), (calloutState->structReturnSize))
-						: memcpy(firstIndexableField(oop1), (calloutState->limit), (calloutState->structReturnSize))),
-				storePointerofObjectwithValue(0, retOop, oop1),
-				methodReturnValue(retOop)));
+;
+			if (returnStructInRegisters((calloutState->structReturnSize))) {
+				memcpy(firstIndexableField(oop1), (&intRet), (calloutState->structReturnSize));
+			}
+			else {
+				memcpy(firstIndexableField(oop1), (calloutState->limit), (calloutState->structReturnSize));
+			}
+			storePointerofObjectwithValue(0, retOop, oop1);
+			oop = methodReturnValue(retOop);
+		}
+		return oop;
 	}
 	if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
 		oop = floatObjectOf(floatRet);
@@ -1827,7 +1840,7 @@
 					: positive64BitIntegerFor(intRet))
 			: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -2015,7 +2028,7 @@
 		/* begin ffiPushPointer:in: */
 		pointer = (calloutState->limit);
 		if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer;
+			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer));
 			(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -2156,7 +2169,7 @@
 					/* begin ffiReturnCStringFrom: */
 					cPointer = ((usqInt) intRet);
 					if (cPointer == null) {
-						methodReturnValue(nilObject());
+						oop3 = methodReturnValue(nilObject());
 						goto l6;
 					}
 					cString = ((char *) cPointer);
@@ -2169,7 +2182,7 @@
 					for (i1 = 0; i1 < strLen; i1 += 1) {
 						strPtr[i1] = (cString[i1]);
 					}
-					methodReturnValue(strOop);
+					oop3 = methodReturnValue(strOop);
 					goto l6;
 				}
 				
@@ -2209,7 +2222,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(1, retOop1, retType);
-				methodReturnValue(retOop1);
+				oop3 = methodReturnValue(retOop1);
 				goto l6;
 			}
 			classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
@@ -2238,7 +2251,7 @@
 #endif /* SPURVM */
 ;
 			storePointerofObjectwithValue(0, retOop1, oop2);
-			result = methodReturnValue(retOop1);
+			oop3 = methodReturnValue(retOop1);
 		l6:	/* end ffiReturnPointer:ofType:in: */;
 		}
 		else {
@@ -2268,8 +2281,9 @@
 				memcpy(firstIndexableField(oop1), (calloutState->limit), (calloutState->structReturnSize));
 			}
 			storePointerofObjectwithValue(0, retOop, oop1);
-			result = methodReturnValue(retOop);
+			oop3 = methodReturnValue(retOop);
 		}
+		result = oop3;
 		goto l7;
 	}
 	if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -2325,7 +2339,7 @@
 					: positive64BitIntegerFor(intRet))
 			: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -2445,7 +2459,7 @@
 				: positive64BitIntegerFor(retVal))
 		: characterObjectOf(retVal & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -2828,7 +2842,7 @@
 		}
 		/* begin ffiPushPointer:in: */
 		if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((void *) ptrAddress));
+			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)(((void *) ptrAddress))));
 			(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -2857,7 +2871,7 @@
 		ptrAddress = ((int) (firstIndexableField(oop)));
 		/* begin ffiPushPointer:in: */
 		if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((void *) ptrAddress));
+			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)(((void *) ptrAddress))));
 			(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -2885,7 +2899,7 @@
 			: longAt((oop + BaseHeaderSize) + BytesPerOop));
 		/* begin ffiPushPointer:in: */
 		if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((void *) ptrAddress));
+			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)(((void *) ptrAddress))));
 			(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -2905,7 +2919,7 @@
 ffiPushPointerin(void *pointer, CalloutState *calloutState)
 {
 	if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-		((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer;
+		((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer));
 		(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 	}
 	else {
@@ -3099,7 +3113,7 @@
 	(calloutState->stringArgIndex = ((calloutState->stringArgIndex)) + 1);
 	/* begin ffiPushPointer:in: */
 	if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-		((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = copy;
+		((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)copy));
 		(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 	}
 	else {
@@ -3258,7 +3272,7 @@
 		}
 		/* begin ffiPushPointer:in: */
 		if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((void *) ptrAddress));
+			((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)(((void *) ptrAddress))));
 			(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -4057,7 +4071,7 @@
 			/* begin ffiPushPointer:in: */
 			pointer = (calloutState->limit);
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -4202,7 +4216,7 @@
 						/* begin ffiReturnCStringFrom: */
 						cPointer = ((usqInt) intRet);
 						if (cPointer == null) {
-							methodReturnValue(nilObject());
+							oop3 = methodReturnValue(nilObject());
 							goto l12;
 						}
 						cString = ((char *) cPointer);
@@ -4215,7 +4229,7 @@
 						for (i2 = 0; i2 < strLen; i2 += 1) {
 							strPtr[i2] = (cString[i2]);
 						}
-						methodReturnValue(strOop);
+						oop3 = methodReturnValue(strOop);
 						goto l12;
 					}
 					
@@ -4255,7 +4269,7 @@
 #endif /* SPURVM */
 ;
 					storePointerofObjectwithValue(1, retOop1, retType);
-					methodReturnValue(retOop1);
+					oop3 = methodReturnValue(retOop1);
 					goto l12;
 				}
 				classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
@@ -4284,7 +4298,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(0, retOop1, oop2);
-				result1 = methodReturnValue(retOop1);
+				oop3 = methodReturnValue(retOop1);
 			l12:	/* end ffiReturnPointer:ofType:in: */;
 			}
 			else {
@@ -4314,8 +4328,9 @@
 					memcpy(firstIndexableField(oop11), (calloutState->limit), (calloutState->structReturnSize));
 				}
 				storePointerofObjectwithValue(0, retOop, oop11);
-				result1 = methodReturnValue(retOop);
+				oop3 = methodReturnValue(retOop);
 			}
+			result1 = oop3;
 			goto l13;
 		}
 		if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -4371,7 +4386,7 @@
 						: positive64BitIntegerFor(intRet))
 				: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -4513,7 +4528,7 @@
 		/* begin ffiPushPointer:in: */
 		pointer1 = (calloutState1->limit);
 		if (((calloutState1->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState1->integerRegisters))[(calloutState1->integerRegisterIndex)] = pointer1;
+			((calloutState1->integerRegisters))[(calloutState1->integerRegisterIndex)] = (((sqInt)pointer1));
 			(calloutState1->integerRegisterIndex = ((calloutState1->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -4658,7 +4673,7 @@
 					/* begin ffiReturnCStringFrom: */
 					cPointer1 = ((usqInt) intRet1);
 					if (cPointer1 == null) {
-						methodReturnValue(nilObject());
+						oop4 = methodReturnValue(nilObject());
 						goto l15;
 					}
 					cString1 = ((char *) cPointer1);
@@ -4671,7 +4686,7 @@
 					for (i3 = 0; i3 < strLen1; i3 += 1) {
 						strPtr1[i3] = (cString1[i3]);
 					}
-					methodReturnValue(strOop1);
+					oop4 = methodReturnValue(strOop1);
 					goto l15;
 				}
 				
@@ -4711,7 +4726,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(1, retOop11, retType1);
-				methodReturnValue(retOop11);
+				oop4 = methodReturnValue(retOop11);
 				goto l15;
 			}
 			classOop1 = (((calloutState1->ffiRetHeader)) & FFIFlagStructure
@@ -4740,7 +4755,7 @@
 #endif /* SPURVM */
 ;
 			storePointerofObjectwithValue(0, retOop11, oop21);
-			result2 = methodReturnValue(retOop11);
+			oop4 = methodReturnValue(retOop11);
 		l15:	/* end ffiReturnPointer:ofType:in: */;
 		}
 		else {
@@ -4770,8 +4785,9 @@
 				memcpy(firstIndexableField(oop12), (calloutState1->limit), (calloutState1->structReturnSize));
 			}
 			storePointerofObjectwithValue(0, retOop2, oop12);
-			result2 = methodReturnValue(retOop2);
+			oop4 = methodReturnValue(retOop2);
 		}
+		result2 = oop4;
 		goto l16;
 	}
 	if ((((usqInt) atomicType2) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -4827,7 +4843,7 @@
 					: positive64BitIntegerFor(intRet1))
 			: characterObjectOf(intRet1 & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -5109,7 +5125,7 @@
 			/* begin ffiPushPointer:in: */
 			pointer = (calloutState->limit);
 			if (((calloutState->integerRegisterIndex)) < NumIntRegArgs) {
-				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = pointer;
+				((calloutState->integerRegisters))[(calloutState->integerRegisterIndex)] = (((sqInt)pointer));
 				(calloutState->integerRegisterIndex = ((calloutState->integerRegisterIndex)) + 1);
 			}
 			else {
@@ -5254,7 +5270,7 @@
 						/* begin ffiReturnCStringFrom: */
 						cPointer = ((usqInt) intRet);
 						if (cPointer == null) {
-							methodReturnValue(nilObject());
+							oop3 = methodReturnValue(nilObject());
 							goto l12;
 						}
 						cString = ((char *) cPointer);
@@ -5267,7 +5283,7 @@
 						for (i2 = 0; i2 < strLen; i2 += 1) {
 							strPtr[i2] = (cString[i2]);
 						}
-						methodReturnValue(strOop);
+						oop3 = methodReturnValue(strOop);
 						goto l12;
 					}
 					
@@ -5307,7 +5323,7 @@
 #endif /* SPURVM */
 ;
 					storePointerofObjectwithValue(1, retOop1, retType);
-					methodReturnValue(retOop1);
+					oop3 = methodReturnValue(retOop1);
 					goto l12;
 				}
 				classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
@@ -5336,7 +5352,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(0, retOop1, oop2);
-				result1 = methodReturnValue(retOop1);
+				oop3 = methodReturnValue(retOop1);
 			l12:	/* end ffiReturnPointer:ofType:in: */;
 			}
 			else {
@@ -5366,8 +5382,9 @@
 					memcpy(firstIndexableField(oop11), (calloutState->limit), (calloutState->structReturnSize));
 				}
 				storePointerofObjectwithValue(0, retOop, oop11);
-				result1 = methodReturnValue(retOop);
+				oop3 = methodReturnValue(retOop);
 			}
+			result1 = oop3;
 			goto l13;
 		}
 		if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -5423,7 +5440,7 @@
 						: positive64BitIntegerFor(intRet))
 				: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -5571,7 +5588,7 @@
 		/* begin ffiPushPointer:in: */
 		pointer1 = (calloutState1->limit);
 		if (((calloutState1->integerRegisterIndex)) < NumIntRegArgs) {
-			((calloutState1->integerRegisters))[(calloutState1->integerRegisterIndex)] = pointer1;
+			((calloutState1->integerRegisters))[(calloutState1->integerRegisterIndex)] = (((sqInt)pointer1));
 			(calloutState1->integerRegisterIndex = ((calloutState1->integerRegisterIndex)) + 1);
 		}
 		else {
@@ -5716,7 +5733,7 @@
 					/* begin ffiReturnCStringFrom: */
 					cPointer1 = ((usqInt) intRet1);
 					if (cPointer1 == null) {
-						methodReturnValue(nilObject());
+						oop4 = methodReturnValue(nilObject());
 						goto l15;
 					}
 					cString1 = ((char *) cPointer1);
@@ -5729,7 +5746,7 @@
 					for (i3 = 0; i3 < strLen1; i3 += 1) {
 						strPtr1[i3] = (cString1[i3]);
 					}
-					methodReturnValue(strOop1);
+					oop4 = methodReturnValue(strOop1);
 					goto l15;
 				}
 				
@@ -5769,7 +5786,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(1, retOop11, retType1);
-				methodReturnValue(retOop11);
+				oop4 = methodReturnValue(retOop11);
 				goto l15;
 			}
 			classOop1 = (((calloutState1->ffiRetHeader)) & FFIFlagStructure
@@ -5798,7 +5815,7 @@
 #endif /* SPURVM */
 ;
 			storePointerofObjectwithValue(0, retOop11, oop21);
-			result2 = methodReturnValue(retOop11);
+			oop4 = methodReturnValue(retOop11);
 		l15:	/* end ffiReturnPointer:ofType:in: */;
 		}
 		else {
@@ -5828,8 +5845,9 @@
 				memcpy(firstIndexableField(oop12), (calloutState1->limit), (calloutState1->structReturnSize));
 			}
 			storePointerofObjectwithValue(0, retOop2, oop12);
-			result2 = methodReturnValue(retOop2);
+			oop4 = methodReturnValue(retOop2);
 		}
+		result2 = oop4;
 		goto l16;
 	}
 	if ((((usqInt) atomicType2) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -5885,7 +5903,7 @@
 					: positive64BitIntegerFor(intRet1))
 			: characterObjectOf(intRet1 & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -5998,7 +6016,7 @@
 	oop = instantiateClassindexableSize(classExternalAddress(), 4);
 	ptr = firstIndexableField(oop);
 	ptr[0] = addr;
-	popthenPush(2, oop);
+	return popthenPush(2, oop);
 }
 
 
@@ -6060,7 +6078,7 @@
 	}
 	((int*)addr)[0] = ((int*)(&floatValue))[0];
 	((int*)addr)[1] = ((int*)(&floatValue))[1];
-	popthenPush(3, floatOop);
+	return popthenPush(3, floatOop);
 }
 
 
@@ -6120,7 +6138,7 @@
 		return 0;
 	}
 	((int*)addr)[0] = ((int*)(&floatValue))[0];
-	popthenPush(3, floatOop);
+	return popthenPush(3, floatOop);
 }
 
 
@@ -6232,7 +6250,7 @@
 			? signed32BitIntegerFor(value)
 			: positive32BitIntegerFor(value));
 	}
-	popthenPush(4, value);
+	return popthenPush(4, value);
 }
 
 
@@ -6303,7 +6321,7 @@
 	else {
 		longAtput(addr, value);
 	}
-	popthenPush(5, valueOop);
+	return popthenPush(5, valueOop);
 }
 
 

Modified: branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c
===================================================================
--- branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c	2015-07-09 21:08:58 UTC (rev 3401)
+++ branches/Cog/src/plugins/SqueakFFIPrims/IA32FFIPlugin.c	2015-07-10 21:17:09 UTC (rev 3402)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.1408 uuid: 51bc4e0f-a338-4394-8c6a-22b4b3e07c61
+	VMPluginCodeGenerator VMMaker.oscog-eem.1409 uuid: 428ff402-b7ce-44c6-a95d-5db172a1e43f
    from
-	ThreadedIA32FFIPlugin VMMaker.oscog-eem.1408 uuid: 51bc4e0f-a338-4394-8c6a-22b4b3e07c61
+	ThreadedIA32FFIPlugin VMMaker.oscog-eem.1409 uuid: 428ff402-b7ce-44c6-a95d-5db172a1e43f
  */
-static char __buildInfo[] = "ThreadedIA32FFIPlugin VMMaker.oscog-eem.1408 uuid: 51bc4e0f-a338-4394-8c6a-22b4b3e07c61 " __DATE__ ;
+static char __buildInfo[] = "ThreadedIA32FFIPlugin VMMaker.oscog-eem.1409 uuid: 428ff402-b7ce-44c6-a95d-5db172a1e43f " __DATE__ ;
 
 
 
@@ -352,7 +352,7 @@
 static sqInt (*stackValue)(sqInt offset);
 static sqInt (*storeIntegerofObjectwithValue)(sqInt index, sqInt oop, sqInt integer);
 static sqInt (*storePointerofObjectwithValue)(sqInt index, sqInt oop, sqInt valuePointer);
-static sqInt (*tenuringIncrementalGC)(void);
+static void (*tenuringIncrementalGC)(void);
 static sqInt (*trueObject)(void);
 #else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
 extern sqInt booleanValueOf(sqInt obj);
@@ -438,16 +438,16 @@
 extern sqInt stackValue(sqInt offset);
 extern sqInt storeIntegerofObjectwithValue(sqInt index, sqInt oop, sqInt integer);
 extern sqInt storePointerofObjectwithValue(sqInt index, sqInt oop, sqInt valuePointer);
-extern sqInt tenuringIncrementalGC(void);
+extern void tenuringIncrementalGC(void);
 extern sqInt trueObject(void);
 extern
 #endif
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"IA32FFIPlugin VMMaker.oscog-eem.1408 (i)"
+	"IA32FFIPlugin VMMaker.oscog-eem.1409 (i)"
 #else
-	"IA32FFIPlugin VMMaker.oscog-eem.1408 (e)"
+	"IA32FFIPlugin VMMaker.oscog-eem.1409 (e)"
 #endif
 ;
 
@@ -1460,131 +1460,144 @@
 		/* Note: Order is important here since FFIFlagPointer + FFIFlagStructure is used to represent
 		   'typedef void* VoidPointer' and VoidPointer must be returned as pointer *not* as struct. */
 
-		return (((calloutState->ffiRetHeader)) & FFIFlagPointer
-			? (/* begin ffiReturnPointer:ofType:in: */
-				/* begin ffiReturnType: */
-				(specLiteral1 = (specOnStack
-						? stackValue(1)
-						: literalofMethod(0, primitiveMethod()))),
-				(argTypes1 = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral1)),
-				(retType = fetchPointerofObject(0, argTypes1)),
-				(retClass1 = fetchPointerofObject(1, retType)),
-				(retClass1 == (nilObject())
-						? (/* begin atomicTypeOf: */
-							(typeSpec1 = (calloutState->ffiRetHeader)),
-							(atomicType1 = ((usqInt) (typeSpec1 & FFIAtomicTypeMask)) >> FFIAtomicTypeShift),
-							((((usqInt) atomicType1) >> 1) == (((usqInt) FFITypeSignedChar) >> 1)
-									? (/* begin ffiReturnCStringFrom: */
-										(cPointer = ((usqInt) intRet)),
-										(cPointer == null
-												? (methodReturnValue(nilObject()),
-													goto l2)
-												: 0),
-										(cString = ((char *) cPointer)),
-										(strLen = 0),
-										while (!((cString[strLen]) == 0)) {
-												strLen += 1;
-											}
-										(strOop = instantiateClassindexableSize(classString(), strLen)),
-										(strPtr = firstIndexableField(strOop)),
-										for (i = 0; i < strLen; i += 1) {
-												strPtr[i] = (cString[i]);
-											}
-										methodReturnValue(strOop),
-										goto l2)
-									: 0),
-							
+		if (((calloutState->ffiRetHeader)) & FFIFlagPointer) {
+			/* begin ffiReturnPointer:ofType:in: */
+			/* begin ffiReturnType: */
+			specLiteral1 = (specOnStack
+				? stackValue(1)
+				: literalofMethod(0, primitiveMethod()));
+			argTypes1 = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral1);
+			retType = fetchPointerofObject(0, argTypes1);
+			retClass1 = fetchPointerofObject(1, retType);
+			if (retClass1 == (nilObject())) {
+
+				/* Create ExternalData upon return */
+
+				/* begin atomicTypeOf: */
+				typeSpec1 = (calloutState->ffiRetHeader);
+				atomicType1 = ((usqInt) (typeSpec1 & FFIAtomicTypeMask)) >> FFIAtomicTypeShift;
+				if ((((usqInt) atomicType1) >> 1) == (((usqInt) FFITypeSignedChar) >> 1)) {
+
+					/* String return */
+
+					/* begin ffiReturnCStringFrom: */
+					cPointer = ((usqInt) intRet);
+					if (cPointer == null) {
+						oop = methodReturnValue(nilObject());
+						goto l2;
+					}
+					cString = ((char *) cPointer);
+					strLen = 0;
+					while (!((cString[strLen]) == 0)) {
+						strLen += 1;
+					}
+					strOop = instantiateClassindexableSize(classString(), strLen);
+					strPtr = firstIndexableField(strOop);
+					for (i = 0; i < strLen; i += 1) {
+						strPtr[i] = (cString[i]);
+					}
+					oop = methodReturnValue(strOop);
+					goto l2;
+				}
+				
 #if SPURVM
-								oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
-								ptr = firstIndexableField(oop2);
-								ptr[0] = (((sqInt) intRet));
-								
+				oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
+				ptr = firstIndexableField(oop2);
+				ptr[0] = (((sqInt) intRet));
+				
 #if SPURVM
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
 
 #else /* SPURVM */
-								pushRemappableOop(oop2);
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
-								oop2 = popRemappableOop()
+				pushRemappableOop(oop2);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				oop2 = popRemappableOop()
 #endif /* SPURVM */
 ;
-								storePointerofObjectwithValue(0, retOop1, oop2);
+				storePointerofObjectwithValue(0, retOop1, oop2);
 
 #else /* SPURVM */
-								pushRemappableOop(retType);
-								oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
-								ptr = firstIndexableField(oop2);
-								ptr[0] = (((sqInt) intRet));
-								
+				pushRemappableOop(retType);
+				oop2 = instantiateClassindexableSize(classExternalAddress(), 4);
+				ptr = firstIndexableField(oop2);
+				ptr[0] = (((sqInt) intRet));
+				
 #if SPURVM
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
 
 #else /* SPURVM */
-								pushRemappableOop(oop2);
-								retOop1 = instantiateClassindexableSize(classExternalData(), 0);
-								oop2 = popRemappableOop()
+				pushRemappableOop(oop2);
+				retOop1 = instantiateClassindexableSize(classExternalData(), 0);
+				oop2 = popRemappableOop()
 #endif /* SPURVM */
 ;
-								storePointerofObjectwithValue(0, retOop1, oop2);
-								retType = popRemappableOop()
+				storePointerofObjectwithValue(0, retOop1, oop2);
+				retType = popRemappableOop()
 #endif /* SPURVM */
-,
-							storePointerofObjectwithValue(1, retOop1, retType),
-							methodReturnValue(retOop1),
-							goto l2)
-						: 0),
-				(classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
-						? classByteArray()
-						: classExternalAddress())),
-				
+;
+				storePointerofObjectwithValue(1, retOop1, retType);
+				oop = methodReturnValue(retOop1);
+				goto l2;
+			}
+			classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
+				? classByteArray()
+				: classExternalAddress());
+			
 #if SPURVM
-					oop2 = instantiateClassindexableSize(classOop, 4);
+			oop2 = instantiateClassindexableSize(classOop, 4);
 
 #else /* SPURVM */
-					pushRemappableOop(retClass1);
-					oop2 = instantiateClassindexableSize(classOop, 4);
-					retClass1 = popRemappableOop()
+			pushRemappableOop(retClass1);
+			oop2 = instantiateClassindexableSize(classOop, 4);
+			retClass1 = popRemappableOop()
 #endif /* SPURVM */
-,
-				(ptr = firstIndexableField(oop2)),
-				ptr[0] = (((sqInt) intRet)),
-				
+;
+			ptr = firstIndexableField(oop2);
+			ptr[0] = (((sqInt) intRet));
+			
 #if SPURVM
-					retOop1 = instantiateClassindexableSize(retClass1, 0);
+			retOop1 = instantiateClassindexableSize(retClass1, 0);
 
 #else /* SPURVM */
-					pushRemappableOop(oop2);
-					retOop1 = instantiateClassindexableSize(retClass1, 0);
-					oop2 = popRemappableOop()
+			pushRemappableOop(oop2);
+			retOop1 = instantiateClassindexableSize(retClass1, 0);
+			oop2 = popRemappableOop()
 #endif /* SPURVM */
-,
-				storePointerofObjectwithValue(0, retOop1, oop2),
-				methodReturnValue(retOop1),
-			l2:	/* end ffiReturnPointer:ofType:in: */)
-			: (/* begin ffiReturnStruct:ofType:in: */
-				/* begin ffiReturnType: */
-				(specLiteral = (specOnStack
-						? stackValue(1)
-						: literalofMethod(0, primitiveMethod()))),
-				(argTypes = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral)),
-				(ffiRetType = fetchPointerofObject(0, argTypes)),
-				(retClass = fetchPointerofObject(1, ffiRetType)),
-				(retOop = instantiateClassindexableSize(retClass, 0)),
-				
+;
+			storePointerofObjectwithValue(0, retOop1, oop2);
+			oop = methodReturnValue(retOop1);
+		l2:	/* end ffiReturnPointer:ofType:in: */;
+		}
+		else {
+			/* begin ffiReturnStruct:ofType:in: */
+			/* begin ffiReturnType: */
+			specLiteral = (specOnStack
+				? stackValue(1)
+				: literalofMethod(0, primitiveMethod()));
+			argTypes = fetchPointerofObject(ExternalFunctionArgTypesIndex, specLiteral);
+			ffiRetType = fetchPointerofObject(0, argTypes);
+			retClass = fetchPointerofObject(1, ffiRetType);
+			retOop = instantiateClassindexableSize(retClass, 0);
+			
 #if SPURVM
-					oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
+			oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
 
 #else /* SPURVM */
-					pushRemappableOop(retOop);
-					oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
-					retOop = popRemappableOop()
+			pushRemappableOop(retOop);
+			oop1 = instantiateClassindexableSize(classByteArray(), (calloutState->structReturnSize));
+			retOop = popRemappableOop()
 #endif /* SPURVM */
-,
-				(returnStructInRegisters((calloutState->structReturnSize))
-						? memcpy(firstIndexableField(oop1), (&intRet), (calloutState->structReturnSize))
-						: memcpy(firstIndexableField(oop1), (calloutState->limit), (calloutState->structReturnSize))),
-				storePointerofObjectwithValue(0, retOop, oop1),
-				methodReturnValue(retOop)));
+;
+			if (returnStructInRegisters((calloutState->structReturnSize))) {
+				memcpy(firstIndexableField(oop1), (&intRet), (calloutState->structReturnSize));
+			}
+			else {
+				memcpy(firstIndexableField(oop1), (calloutState->limit), (calloutState->structReturnSize));
+			}
+			storePointerofObjectwithValue(0, retOop, oop1);
+			oop = methodReturnValue(retOop);
+		}
+		return oop;
 	}
 	if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
 		oop = floatObjectOf(floatRet);
@@ -1639,7 +1652,7 @@
 					: positive64BitIntegerFor(intRet))
 			: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -1949,7 +1962,7 @@
 					/* begin ffiReturnCStringFrom: */
 					cPointer = ((usqInt) intRet);
 					if (cPointer == null) {
-						methodReturnValue(nilObject());
+						oop3 = methodReturnValue(nilObject());
 						goto l6;
 					}
 					cString = ((char *) cPointer);
@@ -1962,7 +1975,7 @@
 					for (i1 = 0; i1 < strLen; i1 += 1) {
 						strPtr[i1] = (cString[i1]);
 					}
-					methodReturnValue(strOop);
+					oop3 = methodReturnValue(strOop);
 					goto l6;
 				}
 				
@@ -2002,7 +2015,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(1, retOop1, retType);
-				methodReturnValue(retOop1);
+				oop3 = methodReturnValue(retOop1);
 				goto l6;
 			}
 			classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
@@ -2031,7 +2044,7 @@
 #endif /* SPURVM */
 ;
 			storePointerofObjectwithValue(0, retOop1, oop2);
-			result = methodReturnValue(retOop1);
+			oop3 = methodReturnValue(retOop1);
 		l6:	/* end ffiReturnPointer:ofType:in: */;
 		}
 		else {
@@ -2061,8 +2074,9 @@
 				memcpy(firstIndexableField(oop1), (calloutState->limit), (calloutState->structReturnSize));
 			}
 			storePointerofObjectwithValue(0, retOop, oop1);
-			result = methodReturnValue(retOop);
+			oop3 = methodReturnValue(retOop);
 		}
+		result = oop3;
 		goto l7;
 	}
 	if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -2118,7 +2132,7 @@
 					: positive64BitIntegerFor(intRet))
 			: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -2238,7 +2252,7 @@
 				: positive64BitIntegerFor(retVal))
 		: characterObjectOf(retVal & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -3742,7 +3756,7 @@
 						/* begin ffiReturnCStringFrom: */
 						cPointer = ((usqInt) intRet);
 						if (cPointer == null) {
-							methodReturnValue(nilObject());
+							oop3 = methodReturnValue(nilObject());
 							goto l12;
 						}
 						cString = ((char *) cPointer);
@@ -3755,7 +3769,7 @@
 						for (i2 = 0; i2 < strLen; i2 += 1) {
 							strPtr[i2] = (cString[i2]);
 						}
-						methodReturnValue(strOop);
+						oop3 = methodReturnValue(strOop);
 						goto l12;
 					}
 					
@@ -3795,7 +3809,7 @@
 #endif /* SPURVM */
 ;
 					storePointerofObjectwithValue(1, retOop1, retType);
-					methodReturnValue(retOop1);
+					oop3 = methodReturnValue(retOop1);
 					goto l12;
 				}
 				classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
@@ -3824,7 +3838,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(0, retOop1, oop2);
-				result1 = methodReturnValue(retOop1);
+				oop3 = methodReturnValue(retOop1);
 			l12:	/* end ffiReturnPointer:ofType:in: */;
 			}
 			else {
@@ -3854,8 +3868,9 @@
 					memcpy(firstIndexableField(oop11), (calloutState->limit), (calloutState->structReturnSize));
 				}
 				storePointerofObjectwithValue(0, retOop, oop11);
-				result1 = methodReturnValue(retOop);
+				oop3 = methodReturnValue(retOop);
 			}
+			result1 = oop3;
 			goto l13;
 		}
 		if ((((usqInt) atomicType) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -3911,7 +3926,7 @@
 						: positive64BitIntegerFor(intRet))
 				: characterObjectOf(intRet & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -4180,7 +4195,7 @@
 					/* begin ffiReturnCStringFrom: */
 					cPointer1 = ((usqInt) intRet1);
 					if (cPointer1 == null) {
-						methodReturnValue(nilObject());
+						oop4 = methodReturnValue(nilObject());
 						goto l15;
 					}
 					cString1 = ((char *) cPointer1);
@@ -4193,7 +4208,7 @@
 					for (i3 = 0; i3 < strLen1; i3 += 1) {
 						strPtr1[i3] = (cString1[i3]);
 					}
-					methodReturnValue(strOop1);
+					oop4 = methodReturnValue(strOop1);
 					goto l15;
 				}
 				
@@ -4233,7 +4248,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(1, retOop11, retType1);
-				methodReturnValue(retOop11);
+				oop4 = methodReturnValue(retOop11);
 				goto l15;
 			}
 			classOop1 = (((calloutState1->ffiRetHeader)) & FFIFlagStructure
@@ -4262,7 +4277,7 @@
 #endif /* SPURVM */
 ;
 			storePointerofObjectwithValue(0, retOop11, oop21);
-			result2 = methodReturnValue(retOop11);
+			oop4 = methodReturnValue(retOop11);
 		l15:	/* end ffiReturnPointer:ofType:in: */;
 		}
 		else {
@@ -4292,8 +4307,9 @@
 				memcpy(firstIndexableField(oop12), (calloutState1->limit), (calloutState1->structReturnSize));
 			}
 			storePointerofObjectwithValue(0, retOop2, oop12);
-			result2 = methodReturnValue(retOop2);
+			oop4 = methodReturnValue(retOop2);
 		}
+		result2 = oop4;
 		goto l16;
 	}
 	if ((((usqInt) atomicType2) >> 1) == (FFITypeSingleFloat > 1)) {
@@ -4349,7 +4365,7 @@
 					: positive64BitIntegerFor(intRet1))
 			: characterObjectOf(intRet1 & (
 #if SPURVM
-	0xFFFFFFFFUL
+	0xFFFFFFFFULL
 #else /* SPURVM */
 	0xFF
 #endif /* SPURVM */
@@ -4756,7 +4772,7 @@
 						/* begin ffiReturnCStringFrom: */
 						cPointer = ((usqInt) intRet);
 						if (cPointer == null) {
-							methodReturnValue(nilObject());
+							oop3 = methodReturnValue(nilObject());
 							goto l12;
 						}
 						cString = ((char *) cPointer);
@@ -4769,7 +4785,7 @@
 						for (i2 = 0; i2 < strLen; i2 += 1) {
 							strPtr[i2] = (cString[i2]);
 						}
-						methodReturnValue(strOop);
+						oop3 = methodReturnValue(strOop);
 						goto l12;
 					}
 					
@@ -4809,7 +4825,7 @@
 #endif /* SPURVM */
 ;
 					storePointerofObjectwithValue(1, retOop1, retType);
-					methodReturnValue(retOop1);
+					oop3 = methodReturnValue(retOop1);
 					goto l12;
 				}
 				classOop = (((calloutState->ffiRetHeader)) & FFIFlagStructure
@@ -4838,7 +4854,7 @@
 #endif /* SPURVM */
 ;
 				storePointerofObjectwithValue(0, retOop1, oop2);
-				result1 = methodReturnValue(retOop1);
+				oop3 = methodReturnValue(retOop1);
 			l12:	/* end ffiReturnPointer:ofType:in: */;
 			}
 			else {
@@ -4868,8 +4884,9 @@

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list