[Vm-dev] [commit][3403] CogVM source as per VMMaker.oscog-eem.1417

commits at squeakvm.org commits at squeakvm.org
Tue Jul 14 22:46:04 UTC 2015


Revision: 3403
Author:   eliot
Date:     2015-07-14 15:46:03 -0700 (Tue, 14 Jul 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1417

General:
Change the type of the event buffer from int[8] to long[8], along with the
matching event typedefs in sq.h.  Add a fence before reading checkSignalRequests
and useTideA in doSignalExternalSemaphores.

Newspeak:
Spill ReceiverResultReg before the runtime call to fix pushEnclosingObject on
ARM.  ReceiverResultReg is edx/caller-saved on IA32 but r7/callee-saved on ARM.

Compile Newspeak self and super sends as clean sends as well.

Slower in monomorphic case but net win for the larger benchmarks, presumably
because it avoids I-cache flushes in the polymorphic case.  Also means implem-
enting polymorphic caches for clean sends will benefit all non-ordinary sends.

DeltaBlue +8.2%
Splay +7.6%
ParserCombinators +4.7%
Richards +0.5%
SlotRead (replaced with self send) -17.6%

ARM Cogit:
Implement machine code div/mod primitives on ARM, calling __aeabit_idivmod for
the implementation.

Unix:
Fix a warning in the drop plugin.

Modified Paths:
--------------
    branches/Cog/build.linux64x64/squeak.stack.spur/build/mvm
    branches/Cog/build.linux64x64/squeak.stack.spur/build.assert/mvm
    branches/Cog/build.linux64x64/squeak.stack.spur/build.debug/mvm
    branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c
    branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/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/platforms/Cross/vm/sq.h
    branches/Cog/platforms/Cross/vm/sqExternalSemaphores.c
    branches/Cog/platforms/unix/plugins/DropPlugin/sqUnixDragDrop.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogitARMv5.c
    branches/Cog/spursistasrc/vm/cogitIA32.c
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cogitARMv5.c
    branches/Cog/spursrc/vm/cogitIA32.c
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/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/plugins/FilePlugin/FilePlugin.c
    branches/Cog/src/plugins/LargeIntegers/LargeIntegers.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cogitARMv5.c
    branches/Cog/src/vm/cogitIA32.c
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    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/build.linux64x64/squeak.stack.spur/build/mvm
===================================================================
--- branches/Cog/build.linux64x64/squeak.stack.spur/build/mvm	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/build.linux64x64/squeak.stack.spur/build/mvm	2015-07-14 22:46:03 UTC (rev 3403)
@@ -10,7 +10,7 @@
 read a
 case $a in
 n|no|N|NO)	echo "ok but this isn't safe!!";;
-*)			rm config.h; test -f Makefile && make reallyclean
+*)			rm -f config.h; test -f Makefile && make reallyclean
 esac
 test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
 test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)

Modified: branches/Cog/build.linux64x64/squeak.stack.spur/build.assert/mvm
===================================================================
--- branches/Cog/build.linux64x64/squeak.stack.spur/build.assert/mvm	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/build.linux64x64/squeak.stack.spur/build.assert/mvm	2015-07-14 22:46:03 UTC (rev 3403)
@@ -11,7 +11,7 @@
 read a
 case $a in
 n|no|N|NO)	echo "ok but this isn't safe!!";;
-*)			rm config.h; test -f Makefile && make reallyclean
+*)			rm -f config.h; test -f Makefile && make reallyclean
 esac
 test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
 test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)

Modified: branches/Cog/build.linux64x64/squeak.stack.spur/build.debug/mvm
===================================================================
--- branches/Cog/build.linux64x64/squeak.stack.spur/build.debug/mvm	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/build.linux64x64/squeak.stack.spur/build.debug/mvm	2015-07-14 22:46:03 UTC (rev 3403)
@@ -11,7 +11,7 @@
 read a
 case $a in
 n|no|N|NO)	echo "ok but this isn't safe!!";;
-*)			rm config.h; test -f Makefile && make reallyclean
+*)			rm -f config.h; test -f Makefile && make reallyclean
 esac
 test -f plugins.int || (test -f ../plugins.int && cp -p ../plugins.int . || cp -p ../../plugins.int .)
 test -f plugins.ext || (test -f ../plugins.ext && cp -p ../plugins.ext . || cp -p ../../plugins.ext .)

Modified: branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c
===================================================================
--- branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/nsspursrc/plugins/FilePlugin/FilePlugin.c	2015-07-14 22:46:03 UTC (rev 3403)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	VMPluginCodeGenerator VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
    from
-	FilePlugin VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076
+	FilePlugin VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
  */
-static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.1359 uuid: 0e62a222-6136-430f-9bc2-8e7cee245076 " __DATE__ ;
+static char __buildInfo[] = "FilePlugin VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b " __DATE__ ;
 
 
 
@@ -126,7 +126,7 @@
 static sqInt (*stackIntegerValue)(sqInt offset);
 static sqInt (*stackValue)(sqInt offset);
 static sqInt (*storePointerofObjectwithValue)(sqInt index, sqInt oop, sqInt valuePointer);
-static sqInt (*tenuringIncrementalGC)(void);
+static void (*tenuringIncrementalGC)(void);
 static sqInt (*topRemappableOop)(void);
 static sqInt (*trueObject)(void);
 #else /* !defined(SQUEAK_BUILTIN_PLUGIN) */
@@ -170,7 +170,7 @@
 extern sqInt stackIntegerValue(sqInt offset);
 extern sqInt stackValue(sqInt offset);
 extern sqInt storePointerofObjectwithValue(sqInt index, sqInt oop, sqInt valuePointer);
-extern sqInt tenuringIncrementalGC(void);
+extern void tenuringIncrementalGC(void);
 extern sqInt topRemappableOop(void);
 extern sqInt trueObject(void);
 extern
@@ -178,9 +178,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"FilePlugin VMMaker.oscog-eem.1359 (i)"
+	"FilePlugin VMMaker.oscog-eem.1417 (i)"
 #else
-	"FilePlugin VMMaker.oscog-eem.1359 (e)"
+	"FilePlugin VMMaker.oscog-eem.1417 (e)"
 #endif
 ;
 static void * sCCPfn;

Modified: branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c
===================================================================
--- branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/nsspursrc/plugins/LargeIntegers/LargeIntegers.c	2015-07-14 22:46:03 UTC (rev 3403)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1325 uuid: a0bb0f7f-5e6e-48a7-bf73-fa5d135e06c0
+	SmartSyntaxPluginCodeGenerator VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
    from
-	LargeIntegersPlugin VMMaker.oscog-eem.1325 uuid: a0bb0f7f-5e6e-48a7-bf73-fa5d135e06c0
+	LargeIntegersPlugin VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
  */
-static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.1325 uuid: a0bb0f7f-5e6e-48a7-bf73-fa5d135e06c0 " __DATE__ ;
+static char __buildInfo[] = "LargeIntegersPlugin VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b " __DATE__ ;
 
 
 
@@ -174,9 +174,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"LargeIntegers v1.5 VMMaker.oscog-eem.1325 (i)"
+	"LargeIntegers v1.5 VMMaker.oscog-eem.1417 (i)"
 #else
-	"LargeIntegers v1.5 VMMaker.oscog-eem.1325 (e)"
+	"LargeIntegers v1.5 VMMaker.oscog-eem.1417 (e)"
 #endif
 ;
 static const int  orOpIndex = 1;
@@ -312,7 +312,7 @@
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesObject), newLen);
 
 #else /* SPURVM */
-pushRemappableOop(aBytesObject);
+	pushRemappableOop(aBytesObject);
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesObject), newLen);
 	aBytesObject = popRemappableOop()
 #endif /* SPURVM */
@@ -362,7 +362,7 @@
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesOop), newLen);
 
 #else /* SPURVM */
-pushRemappableOop(aBytesOop);
+	pushRemappableOop(aBytesOop);
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesOop), newLen);
 	aBytesOop = popRemappableOop()
 #endif /* SPURVM */
@@ -478,7 +478,7 @@
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesOop), newLen);
 
 #else /* SPURVM */
-pushRemappableOop(aBytesOop);
+	pushRemappableOop(aBytesOop);
 	newBytes = instantiateClassindexableSize(fetchClassOf(aBytesOop), newLen);
 	aBytesOop = popRemappableOop()
 #endif /* SPURVM */
@@ -1219,7 +1219,7 @@
 	sum = instantiateClassindexableSize(resClass, longLen);
 
 #else /* SPURVM */
-pushRemappableOop(shortInt);
+	pushRemappableOop(shortInt);
 	pushRemappableOop(longInt);
 	sum = instantiateClassindexableSize(resClass, longLen);
 	longInt = popRemappableOop();
@@ -1251,7 +1251,7 @@
 		newSum = instantiateClassindexableSize(resClass, longLen + 1);
 
 #else /* SPURVM */
-pushRemappableOop(sum);
+		pushRemappableOop(sum);
 		newSum = instantiateClassindexableSize(resClass, longLen + 1);
 		sum = popRemappableOop()
 #endif /* SPURVM */
@@ -1298,7 +1298,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -1319,7 +1319,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -1350,7 +1350,7 @@
 	result = instantiateClassindexableSize(classLargePositiveInteger(), longLen);
 
 #else /* SPURVM */
-pushRemappableOop(shortLarge);
+	pushRemappableOop(shortLarge);
 	pushRemappableOop(longLarge);
 	result = instantiateClassindexableSize(classLargePositiveInteger(), longLen);
 	longLarge = popRemappableOop();
@@ -1483,7 +1483,7 @@
 		result = instantiateClassindexableSize(classArray(), 2);
 
 #else /* SPURVM */
-pushRemappableOop(firstInteger);
+		pushRemappableOop(firstInteger);
 		result = instantiateClassindexableSize(classArray(), 2);
 		firstInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -1499,7 +1499,7 @@
 	div = bytesOrIntgrowTo(div, (digitLength(div)) + 1);
 
 #else /* SPURVM */
-pushRemappableOop(firstInteger);
+	pushRemappableOop(firstInteger);
 	div = bytesLshift(secondInteger, d);
 	div = bytesOrIntgrowTo(div, (digitLength(div)) + 1);
 	firstInteger = popRemappableOop()
@@ -1513,7 +1513,7 @@
 	}
 
 #else /* SPURVM */
-pushRemappableOop(div);
+	pushRemappableOop(div);
 	rem = bytesLshift(firstInteger, d);
 	if ((digitLength(rem)) == firstLen) {
 		rem = bytesOrIntgrowTo(rem, firstLen + 1);
@@ -1526,7 +1526,7 @@
 	quo = instantiateClassindexableSize(resultClass, l);
 
 #else /* SPURVM */
-pushRemappableOop(div);
+	pushRemappableOop(div);
 	pushRemappableOop(rem);
 	quo = instantiateClassindexableSize(resultClass, l);
 	rem = popRemappableOop();
@@ -1669,7 +1669,7 @@
 	rem = bytesRshiftbyteslookfirst(rem, d, 0, (digitLength(div)) - 1);
 
 #else /* SPURVM */
-pushRemappableOop(quo);
+	pushRemappableOop(quo);
 	rem = bytesRshiftbyteslookfirst(rem, d, 0, (digitLength(div)) - 1);
 	quo = popRemappableOop()
 #endif /* SPURVM */
@@ -1679,7 +1679,7 @@
 	result = instantiateClassindexableSize(classArray(), 2);
 
 #else /* SPURVM */
-pushRemappableOop(quo);
+	pushRemappableOop(quo);
 	pushRemappableOop(rem);
 	result = instantiateClassindexableSize(classArray(), 2);
 	rem = popRemappableOop();
@@ -1749,7 +1749,7 @@
 	prod = instantiateClassindexableSize(classLargePositiveInteger(), thirdLen);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+	pushRemappableOop(firstLarge);
 	pushRemappableOop(secondLarge);
 	pushRemappableOop(thirdLarge);
 	prod = instantiateClassindexableSize(classLargePositiveInteger(), thirdLen);
@@ -1862,7 +1862,7 @@
 	prod = instantiateClassindexableSize(resultClass, longLen + shortLen);
 
 #else /* SPURVM */
-pushRemappableOop(shortInt);
+	pushRemappableOop(shortInt);
 	pushRemappableOop(longInt);
 	prod = instantiateClassindexableSize(resultClass, longLen + shortLen);
 	longInt = popRemappableOop();
@@ -2011,7 +2011,7 @@
 		: classLargePositiveInteger()), resLen);
 
 #else /* SPURVM */
-pushRemappableOop(smaller);
+	pushRemappableOop(smaller);
 	pushRemappableOop(larger);
 	res = instantiateClassindexableSize((neg
 		? classLargeNegativeInteger()
@@ -2409,7 +2409,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -2427,7 +2427,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -2471,7 +2471,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -2489,7 +2489,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -2967,7 +2967,7 @@
 		firstAsLargeInteger = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstAsLargeInteger = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -2989,7 +2989,7 @@
 		secondAsLargeInteger = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstAsLargeInteger);
+		pushRemappableOop(firstAsLargeInteger);
 		secondAsLargeInteger = createLargeFromSmallInteger(secondInteger);
 		firstAsLargeInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3039,7 +3039,7 @@
 		firstAsLargeInteger = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstAsLargeInteger = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3061,7 +3061,7 @@
 		secondAsLargeInteger = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstAsLargeInteger);
+		pushRemappableOop(firstAsLargeInteger);
 		secondAsLargeInteger = createLargeFromSmallInteger(secondInteger);
 		firstAsLargeInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3107,7 +3107,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3125,7 +3125,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -3171,7 +3171,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3189,7 +3189,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -3233,7 +3233,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3251,7 +3251,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -3295,7 +3295,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondInteger);
+		pushRemappableOop(secondInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		secondInteger = popRemappableOop()
 #endif /* SPURVM */
@@ -3313,7 +3313,7 @@
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		secondLarge = createLargeFromSmallInteger(secondInteger);
 		firstLarge = popRemappableOop()
 #endif /* SPURVM */
@@ -3400,7 +3400,7 @@
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 
 #else /* SPURVM */
-pushRemappableOop(secondOperandInteger);
+		pushRemappableOop(secondOperandInteger);
 		pushRemappableOop(thirdModuloInteger);
 		firstLarge = createLargeFromSmallInteger(firstInteger);
 		thirdModuloInteger = popRemappableOop();
@@ -3420,7 +3420,7 @@
 		secondLarge = createLargeFromSmallInteger(secondOperandInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		pushRemappableOop(thirdModuloInteger);
 		secondLarge = createLargeFromSmallInteger(secondOperandInteger);
 		thirdModuloInteger = popRemappableOop();
@@ -3440,7 +3440,7 @@
 		thirdLarge = createLargeFromSmallInteger(thirdModuloInteger);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+		pushRemappableOop(firstLarge);
 		pushRemappableOop(secondLarge);
 		thirdLarge = createLargeFromSmallInteger(thirdModuloInteger);
 		secondLarge = popRemappableOop();
@@ -3473,7 +3473,7 @@
 	prod = instantiateClassindexableSize(classLargePositiveInteger(), thirdLen);
 
 #else /* SPURVM */
-pushRemappableOop(firstLarge);
+	pushRemappableOop(firstLarge);
 	pushRemappableOop(secondLarge);
 	pushRemappableOop(thirdLarge);
 	prod = instantiateClassindexableSize(classLargePositiveInteger(), thirdLen);

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-07-14 22:46:03 UTC (rev 3403)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1403 uuid: 66fdf690-416b-4359-be28-c0387023baa6
+	CCodeGenerator VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-07-14 22:46:03 UTC (rev 3403)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1407 uuid: cc7c9003-2145-44b0-a3bd-937c285968bb
+	CCodeGenerator VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1407 uuid: cc7c9003-2145-44b0-a3bd-937c285968bb
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1407 uuid: cc7c9003-2145-44b0-a3bd-937c285968bb " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -271,6 +271,9 @@
 #define LogicalShiftLeftRR 87
 #define LogicalShiftRightCqR 84
 #define LogicalShiftRightRR 85
+#define LookupRuleDynamicSuper 0x101
+#define LookupRuleImplicit 0x100
+#define LookupRuleSelf 0
 #define LR 14
 #define LS 9
 #define LT 11
@@ -433,6 +436,7 @@
 static sqInt addsrnimmror(AbstractInstruction * self_in_addsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) NoDbgRegParms;
 static sqInt addrnimmror(AbstractInstruction * self_in_addrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) NoDbgRegParms;
 static sqInt addrnrm(AbstractInstruction * self_in_addrnrm, sqInt destReg, sqInt srcReg, sqInt addReg) NoDbgRegParms;
+static usqInt aeabiDivModFunctionAddr(AbstractInstruction * self_in_aeabiDivModFunctionAddr) NoDbgRegParms;
 static sqInt andsrnimmror(AbstractInstruction * self_in_andsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) NoDbgRegParms;
 static sqInt andrnimmror(AbstractInstruction * self_in_andrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) NoDbgRegParms;
 static sqInt bicsrnimmror(AbstractInstruction * self_in_bicsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot) NoDbgRegParms;
@@ -563,7 +567,6 @@
 static AbstractInstruction * annotateAbsolutePCRef(AbstractInstruction *abstractInstruction) NoDbgRegParms;
 static AbstractInstruction * annotateBytecode(AbstractInstruction *abstractInstruction) NoDbgRegParms;
 static AbstractInstruction * annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop) NoDbgRegParms;
-static sqInt annotationForMcpcin(sqInt mcpc, CogMethod *cogHomeMethod) NoDbgRegParms;
 static void assertSaneJumpTarget(AbstractInstruction *jumpTarget) NoDbgRegParms;
 static sqInt blockCreationBytecodeSizeForHeader(sqInt methodHeader) NoDbgRegParms;
 static sqInt blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) NoDbgRegParms;
@@ -643,6 +646,7 @@
 static sqInt generateInstructionsAt(sqInt eventualAbsoluteAddress) NoDbgRegParms;
 static sqInt generateMapAtstart(sqInt addressOrNull, sqInt startAddress) NoDbgRegParms;
 static void generateNewspeakRuntime(void);
+static void generateNewspeakSendTrampolines(void);
 static void generateOpenPICPrototype(void);
 static void generateRunTimeTrampolines(void);
 static void generateStackPointerCapture(void);
@@ -652,7 +656,7 @@
 static sqInt genInnerPICAbortTrampoline(char *name) NoDbgRegParms;
 static sqInt genLoadCStackPointersForPrimCall(void);
 static sqInt genNonLocalReturnTrampoline(void);
-static sqInt genNSSendTrampolineFornumArgscalled(void *aRoutine, sqInt numArgs, char *aString) NoDbgRegParms;
+static sqInt genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt numArgs, sqInt eoCheckFlag, char *aString) NoDbgRegParms;
 static sqInt genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
 static sqInt genSafeTrampolineForcalled(void *aRoutine, char *aString) NoDbgRegParms;
 static sqInt genSafeTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
@@ -1025,9 +1029,11 @@
 static sqInt genReturnNil(void);
 static sqInt genReturnTrue(void);
 static sqInt genSecondExtendedSendBytecode(void);
+static sqInt genSendAbsentDynamicSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendAbsentImplicit0ArgsBytecode(void);
 static sqInt genSendAbsentImplicitnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendAbsentOuternumArgsdepth(sqInt selector, sqInt numArgs, sqInt depth) NoDbgRegParms;
+static sqInt genSendAbsentSelfnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendLiteralSelector0ArgsBytecode(void);
 static sqInt genSendLiteralSelector1ArgBytecode(void);
 static sqInt genSendLiteralSelector2ArgsBytecode(void);
@@ -1088,7 +1094,6 @@
 static sqInt genExtPushClosureBytecode(void);
 static void generateEnilopmarts(void);
 static void generateMissAbortTrampolines(void);
-static void generateNewspeakSendTrampolines(void);
 static void generateSendTrampolines(void);
 static void generateTracingTrampolines(void);
 static sqInt genJumpBackTo(sqInt targetBytecodePC) NoDbgRegParms;
@@ -1096,6 +1101,7 @@
 static sqInt genJumpTo(sqInt targetBytecodePC) NoDbgRegParms;
 static sqInt genMarshalledSendnumArgssendTable(sqInt selector, sqInt numArgs, sqInt *sendTable) NoDbgRegParms;
 static sqInt genMethodAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
+static sqInt genNSSendnumArgsdepthsendTable(sqInt selector, sqInt numArgs, sqInt depth, sqInt *sendTable) NoDbgRegParms;
 static sqInt genNullaryInlinePrimitive(sqInt prim) NoDbgRegParms;
 static sqInt genPICAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
 static sqInt genPICMissTrampolineFor(sqInt numArgs) NoDbgRegParms;
@@ -1143,12 +1149,8 @@
 static sqInt genReturnReceiver(void);
 static sqInt genReturnTopFromBlock(void);
 static sqInt genReturnTopFromMethod(void);
-static sqInt genSendAbsentDynamicSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
-static sqInt genSendAbsentImplicitOrOuternumArgsdepthsendTable(sqInt selector, sqInt numArgs, sqInt depth, sqInt *sendTable) NoDbgRegParms;
-static sqInt genSendAbsentSelfnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendDirectedSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
-static sqInt genSendTrampolineFornumArgscalledargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2) NoDbgRegParms;
 static sqInt genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3) NoDbgRegParms;
 static sqInt genSendnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSmallIntegerComparison(sqInt jumpOpcode) NoDbgRegParms;
@@ -1803,11 +1805,11 @@
 	{ genExtSendBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
 	{ genExtSendSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
 	{ genExtSendAbsentImplicitBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
-	{ genExtSendAbsentDynamicSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
+	{ genExtSendAbsentDynamicSuperBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
 	{ genExtUnconditionalJump, v4LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
 	{ genExtJumpIfTrue, v4LongBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0, 0 },
 	{ genExtJumpIfFalse, v4LongBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0, 0 },
-	{ genExtSendAbsentSelfBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0 },
+	{ genExtSendAbsentSelfBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
 	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
 	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
 	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0 },
@@ -2289,6 +2291,26 @@
 }
 
 
+/*	return the address of the __aeabi_idivmod() call provided by the ARM low
+	level libs to do an integer divide that returns the quo in R0 and rem in
+	R1. A word on the somewhat strange usage of idivmod herein; we need a
+	declaration for the _aeabi_idivmod helper function, despite the fact that
+	in a simple C program test, you don't. To get that declaration we need a
+	variable to hang it off and said variable needs to be referred to in order
+	to not get culled. Thus the temp var idivmod, the declaration for it that
+	has nothing to do with it and the odd usage in the inSmalltalk: block.
+ */
+
+	/* CogARMCompiler>>#aeabiDivModFunctionAddr */
+static usqInt
+aeabiDivModFunctionAddr(AbstractInstruction * self_in_aeabiDivModFunctionAddr)
+{
+    extern void __aeabi_idivmod(int dividend, int divisor);
+
+	return (usqInt)__aeabi_idivmod;
+}
+
+
 /*	Remember the ROR is doubled by the cpu so use 30>>1 etc
 	ANDS destReg, srcReg, #immediate ROR #rot */
 
@@ -6079,6 +6101,73 @@
 static AbstractInstruction *
 genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder)
 {
+    AbstractInstruction *abstractInstruction;
+    sqInt callTarget;
+    usqInt divRemFunctionAddr;
+    AbstractInstruction * inst;
+    sqInt rDividend;
+    sqInt rDivisor;
+    sqInt rQuotient;
+    sqInt rRemainder;
+    AbstractInstruction * self_in_saveAndRestoreLinkRegAround;
+
+	assert(abstractRegDividend != abstractRegDivisor);
+	assert(abstractRegQuotient != abstractRegRemainder);
+	rDividend = concreteRegister(self_in_genDivRRQuoRem, abstractRegDividend);
+	rDivisor = concreteRegister(self_in_genDivRRQuoRem, abstractRegDivisor);
+	if (!(rDividend == CArg0Reg)) {
+
+		/* we need to move the value in rDividend to CArg0Reg. Best to double check if rDivisor is already using it first */
+
+		if (rDivisor == CArg0Reg) {
+
+			/* oh dear; we also need to move rDivisor's value out of the way first.. I'll move it to CArg1Reg and if some nitwit has managed to put rDividend there they deserve the crash */
+
+			if (rDividend == CArg1Reg) {
+				error("register choices in genDivR:R:Quo:Rem: made life impossible");
+			}
+			/* begin MoveR:R: */
+			genoperandoperand(MoveRR, rDivisor, CArg1Reg);
+			rDivisor = CArg1Reg;
+		}
+		/* begin MoveR:R: */
+		genoperandoperand(MoveRR, rDividend, CArg0Reg);
+	}
+	if (!(rDivisor == CArg1Reg)) {
+		/* begin MoveR:R: */
+		genoperandoperand(MoveRR, rDivisor, CArg1Reg);
+	}
+	divRemFunctionAddr = aeabiDivModFunctionAddr(self_in_genDivRRQuoRem);
+	/* begin saveAndRestoreLinkRegAround: */
+	self_in_saveAndRestoreLinkRegAround = ((AbstractInstruction *) (backEnd()));
+	/* begin PushR: */
+	inst = genoperand(PushR, LinkReg);
+	/* begin CallFullRT: */
+	callTarget = ((usqInt)divRemFunctionAddr);
+	/* begin CallFull: */
+	/* begin gen:literal: */
+	checkLiteralforInstruction(callTarget, genoperand(CallFull, callTarget));
+
+
+	/* begin PopR: */
+	genoperand(PopR, LinkReg);
+	inst;
+	rQuotient = concreteRegister(self_in_genDivRRQuoRem, abstractRegQuotient);
+	rRemainder = concreteRegister(self_in_genDivRRQuoRem, abstractRegRemainder);
+	if (!(rQuotient == CArg0Reg)) {
+
+		/* oh good grief, not again */
+
+		/* begin MoveR:R: */
+		genoperandoperand(MoveRR, CArg0Reg, rQuotient);
+		if (rQuotient == CArg1Reg) {
+			error("register choices in genDivR:R:Quo:Rem: made life impossible");
+		}
+	}
+	if (!(rRemainder == CArg1Reg)) {
+		/* begin MoveR:R: */
+		genoperandoperand(MoveRR, CArg1Reg, rRemainder);
+	}
 	return self_in_genDivRRQuoRem;
 }
 
@@ -7605,34 +7694,6 @@
 	return abstractInstruction;
 }
 
-
-/*	Answer the annotation for mcpc in cogHomeMethod's map, or 0 if no entry
-	exists. 
- */
-
-	/* Cogit>>#annotationForMcpc:in: */
-static sqInt
-annotationForMcpcin(sqInt mcpc, CogMethod *cogHomeMethod)
-{
-    sqInt annotation;
-    sqInt mapByte;
-    sqInt mapLocation;
-
-	mapLocation = findMapLocationForMcpcinMethod(mcpc, cogHomeMethod);
-	if (mapLocation == 0) {
-		return 0;
-	}
-	mapByte = byteAt(mapLocation);
-	annotation = ((usqInt) mapByte) >> AnnotationShift;
-	if (annotation == IsSendCall) {
-		mapByte = byteAt(mapLocation - 1);
-		if ((((usqInt) mapByte) >> AnnotationShift) == IsAnnotationExtension) {
-			annotation += mapByte & DisplacementMask;
-		}
-	}
-	return annotation;
-}
-
 	/* Cogit>>#assertSaneJumpTarget: */
 static void
 assertSaneJumpTarget(AbstractInstruction *jumpTarget)
@@ -8067,9 +8128,7 @@
 sqInt
 ceSICMiss(sqInt receiver)
 {
-    sqInt annotation;
     sqInt cacheTag;
-    CogMethod *callerMethod;
     sqInt entryPoint;
     sqInt errorSelectorOrNil;
     sqInt errsel;
@@ -8097,22 +8156,6 @@
 	entryPoint = callTargetFromReturnAddress(backEnd, outerReturn);
 	assert(((targetMethod->selector)) != (nilObject()));
 	assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint);
-	callerMethod = mframeHomeMethod(getFramePointer());
-	assert(((outerReturn >= ((((usqInt)callerMethod)) + cmNoCheckEntryOffset)) && (outerReturn <= ((((usqInt)callerMethod)) + ((callerMethod->blockSize))))));
-	annotation = annotationForMcpcin(outerReturn, callerMethod);
-	assert(annotation >= IsSendCall);
-	if (annotation == IsNSSelfSend) {
-		ceSelfSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
-		/* begin unreachable */
-		error("UNREACHABLE");
-	}
-	if (annotation == IsNSDynamicSuperSend) {
-		ceDynamicSuperSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
-		/* begin unreachable */
-		error("UNREACHABLE");
-	}
-
-	assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint);
 	/* begin lookup:for:methodAndErrorSelectorInto: */
 	selector = (targetMethod->selector);
 	methodOrSelectorIndex = lookupOrdinaryreceiver(selector, receiver);
@@ -10825,12 +10868,12 @@
 generateMapAtstart(sqInt addressOrNull, sqInt startAddress)
 {
     unsigned char annotation;
-    sqInt delta;
+    usqInt delta;
     sqInt i;
     AbstractInstruction *instruction;
     sqInt length;
-    sqInt location;
-    sqInt mapEntry;
+    usqInt location;
+    usqInt mapEntry;
     sqInt maxDelta;
     usqInt mcpc;
 
@@ -10899,6 +10942,29 @@
 }
 
 
+/*	Self send, dynamic super send, implicit receiver send, and outer send */
+
+	/* Cogit>>#generateNewspeakSendTrampolines */
+static void
+generateNewspeakSendTrampolines(void)
+{
+    sqInt numArgs;
+
+	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
+		selfSendTrampolines[numArgs] = (genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(ceSelfSendreceiver, numArgs, 0, trampolineNamenumArgs("ceSelfSend", numArgs)));
+	}
+	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
+		dynamicSuperSendTrampolines[numArgs] = (genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(ceDynamicSuperSendreceiver, numArgs, 0, trampolineNamenumArgs("ceDynamicSuperSend", numArgs)));
+	}
+	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
+		implicitReceiverSendTrampolines[numArgs] = (genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(ceImplicitReceiverSendreceiver, numArgs, 1, trampolineNamenumArgs("ceImplicitReceiverSend", numArgs)));
+	}
+	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
+		outerSendTrampolines[numArgs] = (genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(ceOuterSendreceiver, numArgs, 1, trampolineNamenumArgs("ceOuterSend", numArgs)));
+	}
+}
+
+
 /*	Generate the prototype ClosedPIC to determine how much space as full PIC
 	takes. When we first allocate a closed PIC it only has one or two cases
 	and we want to grow it.
@@ -11185,9 +11251,9 @@
 /*	ReceiverResultReg: method receiver
 	SendNumArgsReg: the NSSendCache cache */
 
-	/* Cogit>>#genNSSendTrampolineFor:numArgs:called: */
+	/* Cogit>>#genNSSendTrampolineFor:numArgs:enclosingObjectCheck:called: */
 static sqInt
-genNSSendTrampolineFornumArgscalled(void *aRoutine, sqInt numArgs, char *aString)
+genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt numArgs, sqInt eoCheckFlag, char *aString)
 {
     AbstractInstruction *jumpItsTheReceiverStupid;
     AbstractInstruction *jumpMiss;
@@ -11202,39 +11268,41 @@
 	genoperandoperand(CmpRR, ClassReg, TempReg);
 	/* begin JumpNonZero: */
 	jumpMiss = genoperand(JumpNonZero, ((sqInt)0));
-	/* begin MoveMw:r:R: */
-	/* begin gen:quickConstant:operand:operand: */
-	checkQuickConstantforInstruction(NSCEnclosingObjectIndex * BytesPerWord, genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg));
-	/* begin CmpCq:R: */
-	/* begin gen:quickConstant:operand: */
-	checkQuickConstantforInstruction(0, genoperandoperand(CmpCqR, 0, TempReg));
-	/* begin JumpZero: */
-	jumpItsTheReceiverStupid = genoperand(JumpZero, ((sqInt)0));
-	/* begin MoveR:R: */
-	genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
-	if (numArgs > 2) {
-		if (numArgs >= (NumSendTrampolines - 1)) {
+	if (eoCheckFlag) {
+		/* begin MoveMw:r:R: */
+		/* begin gen:quickConstant:operand:operand: */
+		checkQuickConstantforInstruction(NSCEnclosingObjectIndex * BytesPerWord, genoperandoperandoperand(MoveMwrR, NSCEnclosingObjectIndex * BytesPerWord, SendNumArgsReg, TempReg));
+		/* begin CmpCq:R: */
+		/* begin gen:quickConstant:operand: */
+		checkQuickConstantforInstruction(0, genoperandoperand(CmpCqR, 0, TempReg));
+		/* begin JumpZero: */
+		jumpItsTheReceiverStupid = genoperand(JumpZero, ((sqInt)0));
+		/* begin MoveR:R: */
+		genoperandoperand(MoveRR, TempReg, ReceiverResultReg);
+		if (numArgs > 2) {
+			if (numArgs >= (NumSendTrampolines - 1)) {
 
-			/* arbitrary argument count */
+				/* arbitrary argument count */
 
-			/* begin MoveMw:r:R: */
-			/* begin gen:quickConstant:operand:operand: */
-			checkQuickConstantforInstruction(NSCNumArgsIndex * BytesPerWord, genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg));
-			
-			/* begin MoveR:Xwr:R: */
-			genoperandoperandoperand(MoveRXwrR, ReceiverResultReg, TempReg, SPReg);
-		}
-		else {
+				/* begin MoveMw:r:R: */
+				/* begin gen:quickConstant:operand:operand: */
+				checkQuickConstantforInstruction(NSCNumArgsIndex * BytesPerWord, genoperandoperandoperand(MoveMwrR, NSCNumArgsIndex * BytesPerWord, SendNumArgsReg, TempReg));
+				
+				/* begin MoveR:Xwr:R: */
+				genoperandoperandoperand(MoveRXwrR, ReceiverResultReg, TempReg, SPReg);
+			}
+			else {
 
-			/* Known argument count */
+				/* Known argument count */
 
-			/* begin MoveR:Mw:r: */
-			offset = ((0) + numArgs) * BytesPerWord;
-			/* begin gen:operand:quickConstant:operand: */
-			checkQuickConstantforInstruction(offset, genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg));
+				/* begin MoveR:Mw:r: */
+				offset = ((0) + numArgs) * BytesPerWord;
+				/* begin gen:operand:quickConstant:operand: */
+				checkQuickConstantforInstruction(offset, genoperandoperandoperand(MoveRMwr, TempReg, offset, SPReg));
+			}
 		}
+		jmpTarget(jumpItsTheReceiverStupid, gLabel());
 	}
-	jmpTarget(jumpItsTheReceiverStupid, gLabel());
 	/* begin MoveMw:r:R: */
 	/* begin gen:quickConstant:operand:operand: */
 	checkQuickConstantforInstruction(NSCTargetIndex * BytesPerWord, genoperandoperandoperand(MoveMwrR, NSCTargetIndex * BytesPerWord, SendNumArgsReg, TempReg));
@@ -11244,7 +11312,7 @@
 	genEnsureOopInRegNotForwardedscratchRegupdatingMwr(ReceiverResultReg, TempReg, FoxMFReceiver, FPReg);
 	genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, TempReg);
 
-	return genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 1, ReceiverResultReg, 1);
+	return genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 2, SendNumArgsReg, ReceiverResultReg, null, null, 0, 1, null, 1);
 }
 
 
@@ -13826,14 +13894,14 @@
 static sqInt
 processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex)
 {
-	return 0;
+	return mclassIsSmallInteger(ignoredPrimIndex);
 }
 
 	/* Cogit>>#processorHasDivQuoRem: */
 static sqInt
 processorHasDivQuoRem(sqInt ignoredPrimIndex)
 {
-	return 0;
+	return 1;
 }
 
 	/* Cogit>>#processorHasDoublePrecisionFloatingPointSupport: */
@@ -22193,7 +22261,14 @@
 	return genSendnumArgs(getLiteral(byte1 & 0x3F), ((usqInt) byte1) >> 6);
 }
 
+	/* SimpleStackBasedCogit>>#genSendAbsentDynamicSuper:numArgs: */
+static sqInt
+genSendAbsentDynamicSupernumArgs(sqInt selector, sqInt numArgs)
+{
+	return genNSSendnumArgsdepthsendTable(selector, numArgs, LookupRuleDynamicSuper, dynamicSuperSendTrampolines);
+}
 
+
 /*	160-175	1010 i i i i		Send To Absent Implicit Receiver Literal Selector
 	#iiii With 0 Arguments.
  */
@@ -22209,16 +22284,23 @@
 static sqInt
 genSendAbsentImplicitnumArgs(sqInt selector, sqInt numArgs)
 {
-	return genSendAbsentImplicitOrOuternumArgsdepthsendTable(selector, numArgs, 0xFF, implicitReceiverSendTrampolines);
+	return genNSSendnumArgsdepthsendTable(selector, numArgs, LookupRuleImplicit, implicitReceiverSendTrampolines);
 }
 
 	/* SimpleStackBasedCogit>>#genSendAbsentOuter:numArgs:depth: */
 static sqInt
 genSendAbsentOuternumArgsdepth(sqInt selector, sqInt numArgs, sqInt depth)
 {
-	return genSendAbsentImplicitOrOuternumArgsdepthsendTable(selector, numArgs, depth, outerSendTrampolines);
+	return genNSSendnumArgsdepthsendTable(selector, numArgs, depth, outerSendTrampolines);
 }
 
+	/* SimpleStackBasedCogit>>#genSendAbsentSelf:numArgs: */
+static sqInt
+genSendAbsentSelfnumArgs(sqInt selector, sqInt numArgs)
+{
+	return genNSSendnumArgsdepthsendTable(selector, numArgs, LookupRuleSelf, selfSendTrampolines);
+}
+
 	/* SimpleStackBasedCogit>>#genSendLiteralSelector0ArgsBytecode */
 static sqInt
 genSendLiteralSelector0ArgsBytecode(void)
@@ -24551,40 +24633,10 @@
 }
 
 
-/*	Self send, dynamic super send, implicit receiver send, and outer send. */
 /*	Override to generate code to push the register arg(s) for <= numRegArg
 	arity sends.
  */
 
-	/* StackToRegisterMappingCogit>>#generateNewspeakSendTrampolines */
-static void
-generateNewspeakSendTrampolines(void)
-{
-    sqInt numArgs;
-
-	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
-		selfSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargarg(ceSelfSendtonumArgs, numArgs, trampolineNamenumArgs("ceSelfSend", numArgs), ClassReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2)
-	? numArgs
-	: SendNumArgsReg)));
-	}
-	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
-		dynamicSuperSendTrampolines[numArgs] = (genSendTrampolineFornumArgscalledargargarg(ceDynamicSuperSendtonumArgs, numArgs, trampolineNamenumArgs("ceDynSuperSend", numArgs), ClassReg, ReceiverResultReg, (numArgs <= (NumSendTrampolines - 2)
-	? numArgs
-	: SendNumArgsReg)));
-	}
-	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
-		implicitReceiverSendTrampolines[numArgs] = (genNSSendTrampolineFornumArgscalled(ceImplicitReceiverSendreceiver, numArgs, trampolineNamenumArgs("ceImplicitReceiverSend", numArgs)));
-	}
-	for (numArgs = 0; numArgs < NumSendTrampolines; numArgs += 1) {
-		outerSendTrampolines[numArgs] = (genNSSendTrampolineFornumArgscalled(ceOuterSendreceiver, numArgs, trampolineNamenumArgs("ceOuterSend", numArgs)));
-	}
-}
-
-
-/*	Override to generate code to push the register arg(s) for <= numRegArg
-	arity sends.
- */
-
 	/* StackToRegisterMappingCogit>>#generateSendTrampolines */
 static void
 generateSendTrampolines(void)
@@ -24859,7 +24911,42 @@
 	return genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(ceSICMiss, trampolineNamenumRegArgs("ceMethodAbort", numArgs), 1, ReceiverResultReg, null, null, null, 0, 0, null, 1);
 }
 
+	/* StackToRegisterMappingCogit>>#genNSSend:numArgs:depth:sendTable: */
+static sqInt
+genNSSendnumArgsdepthsendTable(sqInt selector, sqInt numArgs, sqInt depth, sqInt *sendTable)
+{
+    AbstractInstruction *anInstruction;
+    sqInt nsSendCache;
+    NSSendCache * nsSendCache1;
 
+	if (isYoung(selector)) {
+		hasYoungReferent = 1;
+	}
+	nsSendCache = theIRCs + ((NumOopsPerNSC * BytesPerOop) * indexOfIRC);
+	indexOfIRC += 1;
+	assert(isInOldSpace(nsSendCache));
+	/* begin initializeNSSendCache:selector:numArgs:depth: */
+	nsSendCache1 = ((NSSendCache *) nsSendCache);
+	(nsSendCache1->selector = selector);
+	(nsSendCache1->numArgs = numArgs);
+	(nsSendCache1->depth = depth);
+	(nsSendCache1->classTag = 2);
+	ssAllocateCallReg(SendNumArgsReg);
+	marshallAbsentReceiverSendArguments(numArgs);
+	/* begin MoveUniqueCw:R: */
+	/* begin gen:uniqueLiteral:operand: */
+	/* begin uniqueLiteral:forInstruction: */
+	anInstruction = genoperandoperand(MoveCwR, nsSendCache, SendNumArgsReg);
+	assert(usesOutOfLineLiteral(anInstruction));
+	(anInstruction->dependent = allocateLiteral(nsSendCache));
+	anInstruction;
+	CallNewspeakSend(sendTable[((numArgs < (NumSendTrampolines - 1)) ? numArgs : (NumSendTrampolines - 1))]);
+	(optStatus.isReceiverResultRegLive = 0);
+	ssPushRegister(ReceiverResultReg);
+	return 0;
+}
+
+
 /*	Nullary inline primitives. */
 /*	SistaV1: 248		11111000 iiiiiiii		mjjjjjjj		Call Primitive #iiiiiiii +
 	(jjjjjjj * 256) m=1 means inlined primitive, no hard return after
@@ -25741,7 +25828,7 @@
     AbstractInstruction *abstractInstruction;
 
 	(optStatus.isReceiverResultRegLive = 0);
-	ssAllocateCallReg(SendNumArgsReg);
+	ssAllocateCallRegand(SendNumArgsReg, ReceiverResultReg);
 	/* begin MoveCq:R: */
 	/* begin gen:quickConstant:operand: */
 	checkQuickConstantforInstruction(level, genoperandoperand(MoveCqR, level, SendNumArgsReg));
@@ -25983,57 +26070,6 @@
 	return genUpArrowReturn();
 }
 
-	/* StackToRegisterMappingCogit>>#genSendAbsentDynamicSuper:numArgs: */
-static sqInt
-genSendAbsentDynamicSupernumArgs(sqInt selector, sqInt numArgs)
-{
-	marshallAbsentReceiverSendArguments(numArgs);
-	return genMarshalledSendnumArgssendTable(selector, numArgs, dynamicSuperSendTrampolines);
-}
-
-	/* StackToRegisterMappingCogit>>#genSendAbsentImplicitOrOuter:numArgs:depth:sendTable: */
-static sqInt
-genSendAbsentImplicitOrOuternumArgsdepthsendTable(sqInt selector, sqInt numArgs, sqInt depth, sqInt *sendTable)
-{
-    AbstractInstruction *anInstruction;
-    sqInt nsSendCache;
-    NSSendCache * nsSendCache1;
-
-	if (isYoung(selector)) {
-		hasYoungReferent = 1;
-	}
-	nsSendCache = theIRCs + ((NumOopsPerNSC * BytesPerOop) * indexOfIRC);
-	indexOfIRC += 1;
-	assert(isInOldSpace(nsSendCache));
-	/* begin initializeNSSendCache:selector:numArgs:depth: */
-	nsSendCache1 = ((NSSendCache *) nsSendCache);
-	(nsSendCache1->selector = selector);
-	(nsSendCache1->numArgs = numArgs);
-	(nsSendCache1->depth = depth);
-	(nsSendCache1->classTag = 2);
-	ssAllocateCallReg(SendNumArgsReg);
-	marshallAbsentReceiverSendArguments(numArgs);
-	/* begin MoveUniqueCw:R: */
-	/* begin gen:uniqueLiteral:operand: */
-	/* begin uniqueLiteral:forInstruction: */
-	anInstruction = genoperandoperand(MoveCwR, nsSendCache, SendNumArgsReg);
-	assert(usesOutOfLineLiteral(anInstruction));
-	(anInstruction->dependent = allocateLiteral(nsSendCache));
-	anInstruction;
-	CallNewspeakSend(sendTable[((numArgs < (NumSendTrampolines - 1)) ? numArgs : (NumSendTrampolines - 1))]);
-	(optStatus.isReceiverResultRegLive = 0);
-	ssPushRegister(ReceiverResultReg);
-	return 0;
-}
-
-	/* StackToRegisterMappingCogit>>#genSendAbsentSelf:numArgs: */
-static sqInt
-genSendAbsentSelfnumArgs(sqInt selector, sqInt numArgs)
-{
-	marshallAbsentReceiverSendArguments(numArgs);
-	return genMarshalledSendnumArgssendTable(selector, numArgs, selfSendTrampolines);
-}
-
 	/* StackToRegisterMappingCogit>>#genSendDirectedSuper:numArgs: */
 static sqInt
 genSendDirectedSupernumArgs(sqInt selector, sqInt numArgs)
@@ -26054,24 +26090,6 @@
 }
 
 
-/*	Generate a trampoline with three arguments.
-	Hack: a negative value indicates an abstract register, a non-negative
-	value indicates a constant. */
-
-	/* StackToRegisterMappingCogit>>#genSendTrampolineFor:numArgs:called:arg:arg:arg: */
-static sqInt
-genSendTrampolineFornumArgscalledargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2)
-{
-    sqInt startAddress;
-
-	startAddress = methodZoneBase;
-	zeroOpcodeIndex();
-	genPushRegisterArgsForNumArgsscratchReg(backEnd, numArgs, SendNumArgsReg);
-	genTrampolineForcallednumArgsargargargargsaveRegspushLinkRegresultRegappendOpcodes(aRoutine, aString, 3, regOrConst0, regOrConst1, regOrConst2, null, 0, 1, null, 1);
-	return startAddress;
-}
-
-
 /*	Generate a trampoline with four arguments.
 	Hack: a negative value indicates an abstract register, a non-negative
 	value indicates a constant. */

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2015-07-10 21:17:09 UTC (rev 3402)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2015-07-14 22:46:03 UTC (rev 3403)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1401 uuid: 036f0933-639a-49dd-8a1d-a03bcdcb0a0a
+	CCodeGenerator VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1401 uuid: 036f0933-639a-49dd-8a1d-a03bcdcb0a0a
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1401 uuid: 036f0933-639a-49dd-8a1d-a03bcdcb0a0a " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1417 uuid: 5220753e-35a2-46e9-89ad-f7e65d93073b " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -257,6 +257,9 @@
 #define LogicalShiftLeftRR 87
 #define LogicalShiftRightCqR 84
 #define LogicalShiftRightRR 85
+#define LookupRuleDynamicSuper 0x101
+#define LookupRuleImplicit 0x100
+#define LookupRuleSelf 0
 #define MapEnd 0
 #define MaxCompiledPrimitiveIndex 222
 #define MaxMethodSize 65535
@@ -508,7 +511,6 @@
 static AbstractInstruction * annotateAbsolutePCRef(AbstractInstruction *abstractInstruction) NoDbgRegParms;
 static AbstractInstruction * annotateBytecode(AbstractInstruction *abstractInstruction) NoDbgRegParms;
 static AbstractInstruction * annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop) NoDbgRegParms;
-static sqInt annotationForMcpcin(sqInt mcpc, CogMethod *cogHomeMethod) NoDbgRegParms;
 static void assertSaneJumpTarget(AbstractInstruction *jumpTarget) NoDbgRegParms;
 static sqInt blockCreationBytecodeSizeForHeader(sqInt methodHeader) NoDbgRegParms;
 static sqInt blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) NoDbgRegParms;
@@ -588,6 +590,7 @@
 static sqInt generateInstructionsAt(sqInt eventualAbsoluteAddress) NoDbgRegParms;
 static sqInt generateMapAtstart(sqInt addressOrNull, sqInt startAddress) NoDbgRegParms;
 static void generateNewspeakRuntime(void);
+static void generateNewspeakSendTrampolines(void);
 static void generateOpenPICPrototype(void);
 static void generateRunTimeTrampolines(void);
 static void generateStackPointerCapture(void);
@@ -597,7 +600,7 @@
 static sqInt genInnerPICAbortTrampoline(char *name) NoDbgRegParms;
 static sqInt genLoadCStackPointersForPrimCall(void);
 static sqInt genNonLocalReturnTrampoline(void);
-static sqInt genNSSendTrampolineFornumArgscalled(void *aRoutine, sqInt numArgs, char *aString) NoDbgRegParms;
+static sqInt genNSSendTrampolineFornumArgsenclosingObjectCheckcalled(void *aRoutine, sqInt numArgs, sqInt eoCheckFlag, char *aString) NoDbgRegParms;
 static sqInt genReturnTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
 static sqInt genSafeTrampolineForcalled(void *aRoutine, char *aString) NoDbgRegParms;
 static sqInt genSafeTrampolineForcalledarg(void *aRoutine, char *aString, sqInt regOrConst0) NoDbgRegParms;
@@ -945,9 +948,11 @@
 static sqInt genReturnNil(void);
 static sqInt genReturnTrue(void);
 static sqInt genSecondExtendedSendBytecode(void);
+static sqInt genSendAbsentDynamicSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendAbsentImplicit0ArgsBytecode(void);
 static sqInt genSendAbsentImplicitnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendAbsentOuternumArgsdepth(sqInt selector, sqInt numArgs, sqInt depth) NoDbgRegParms;
+static sqInt genSendAbsentSelfnumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static sqInt genSendLiteralSelector0ArgsBytecode(void);
 static sqInt genSendLiteralSelector1ArgBytecode(void);
 static sqInt genSendLiteralSelector2ArgsBytecode(void);
@@ -1008,7 +1013,6 @@
 static sqInt genExtPushClosureBytecode(void);
 static void generateEnilopmarts(void);
 static void generateMissAbortTrampolines(void);
-static void generateNewspeakSendTrampolines(void);
 static void generateSendTrampolines(void);
 static void generateTracingTrampolines(void);
 static sqInt genJumpBackTo(sqInt targetBytecodePC) NoDbgRegParms;
@@ -1016,6 +1020,7 @@
 static sqInt genJumpTo(sqInt targetBytecodePC) NoDbgRegParms;
 static sqInt genMarshalledSendnumArgssendTable(sqInt selector, sqInt numArgs, sqInt *sendTable) NoDbgRegParms;
 static sqInt genMethodAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
+static sqInt genNSSendnumArgsdepthsendTable(sqInt selector, sqInt numArgs, sqInt depth, sqInt *sendTable) NoDbgRegParms;
 static sqInt genNullaryInlinePrimitive(sqInt prim) NoDbgRegParms;
 static sqInt genPICAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
 static sqInt genPICMissTrampolineFor(sqInt numArgs) NoDbgRegParms;
@@ -1063,12 +1068,8 @@
 static sqInt genReturnReceiver(void);
 static sqInt genReturnTopFromBlock(void);
 static sqInt genReturnTopFromMethod(void);

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list