[Vm-dev] [commit][3122] CogVM source as per VMMaker.oscog-eem.920

commits at squeakvm.org commits at squeakvm.org
Mon Nov 3 23:52:58 UTC 2014


Revision: 3122
Author:   eliot
Date:     2014-11-03 15:52:54 -0800 (Mon, 03 Nov 2014)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.920

Fix an assert in addToFreeTree:bytes:

Integrate Ryan's latest absent receiver sends.  Includes nice refactoring of
absent send argument marshalling into its own routine.

Eliminate some compiler warnings in the refactored instVar:ofContext: changes.

Modified Paths:
--------------
    branches/Cog/nscogsrc/vm/cogit.c
    branches/Cog/nscogsrc/vm/cogit.h
    branches/Cog/nscogsrc/vm/cointerp.c
    branches/Cog/nscogsrc/vm/cointerp.h
    branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspursrc/vm/cogit.c
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/sistasrc/vm/cogit.c
    branches/Cog/sistasrc/vm/cogit.h
    branches/Cog/sistasrc/vm/cointerp.c
    branches/Cog/sistasrc/vm/cointerp.h
    branches/Cog/sistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/cogit.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cointerp.c
    branches/Cog/spursistasrc/vm/cointerp.h
    branches/Cog/spursistasrc/vm/gcc3x-cointerp.c
    branches/Cog/spursrc/vm/cogit.c
    branches/Cog/spursrc/vm/cogit.h
    branches/Cog/spursrc/vm/cointerp.c
    branches/Cog/spursrc/vm/cointerp.h
    branches/Cog/spursrc/vm/gcc3x-cointerp.c
    branches/Cog/spurstacksrc/vm/gcc3x-interp.c
    branches/Cog/spurstacksrc/vm/interp.c
    branches/Cog/src/plugins/ADPCMCodecPlugin/ADPCMCodecPlugin.c
    branches/Cog/src/plugins/SoundGenerationPlugin/SoundGenerationPlugin.c
    branches/Cog/src/plugins/SqueakFFIPrims/SqueakFFIPrims.c
    branches/Cog/src/vm/cogit.c
    branches/Cog/src/vm/cogit.h
    branches/Cog/src/vm/cointerp.c
    branches/Cog/src/vm/cointerp.h
    branches/Cog/src/vm/cointerpmt.c
    branches/Cog/src/vm/cointerpmt.h
    branches/Cog/src/vm/gcc3x-cointerp.c
    branches/Cog/src/vm/gcc3x-cointerpmt.c
    branches/Cog/stacksrc/vm/gcc3x-interp.c
    branches/Cog/stacksrc/vm/interp.c

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

Modified: branches/Cog/nscogsrc/vm/cogit.c
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.c	2014-11-03 02:55:09 UTC (rev 3121)
+++ branches/Cog/nscogsrc/vm/cogit.c	2014-11-03 23:52:54 UTC (rev 3122)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.916 uuid: 79925bdf-769f-446f-8532-f04f0e2f11ae
+	CCodeGenerator * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.916 uuid: 79925bdf-769f-446f-8532-f04f0e2f11ae
+	StackToRegisterMappingCogit * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.916 uuid: 79925bdf-769f-446f-8532-f04f0e2f11ae " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -924,6 +924,8 @@
 static sqInt genExtReturnTopFromBlock(void);
 static sqInt genExtSendAbsentDynamicSuperBytecode(void);
 static sqInt genExtSendAbsentImplicitBytecode(void);
+static sqInt genExtSendAbsentOuterBytecode(void);
+static sqInt genExtSendAbsentSelfBytecode(void);
 static sqInt genExtSendBytecode(void);
 static sqInt genExtSendSuperBytecode(void);
 static sqInt genExtStoreAndPopLiteralVariableBytecode(void);
@@ -1088,6 +1090,8 @@
 static sqInt genReturnTopFromMethod(void);
 static sqInt genSendAbsentDynamicSupernumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 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 genSendDynamicSupernumArgs(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;
@@ -1110,7 +1114,7 @@
 static void initSimStackForFramelessBlock(sqInt startpc) NoDbgRegParms;
 static void initSimStackForFramelessMethod(sqInt startpc) NoDbgRegParms;
 static sqInt liveRegisters(void);
-static void marshallImplicitReceiverSendArguments(sqInt numArgs) NoDbgRegParms;
+static void marshallAbsentReceiverSendArguments(sqInt numArgs) NoDbgRegParms;
 static void marshallSendArguments(sqInt numArgs) NoDbgRegParms;
 static void mergeafterContinuation(BytecodeFixup *fixup, sqInt mergeWithContinuation) NoDbgRegParms;
 static sqInt methodAbortTrampolineFor(sqInt numArgs) NoDbgRegParms;
@@ -1749,16 +1753,16 @@
 	{ genExtUnconditionalJump, v4LongBranchDistance, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0 },
 	{ genExtJumpIfTrue, v4LongBranchDistance, 0, 0, 0, 2, 1, 0, 0, 0, 1, 0, 0, 0 },
 	{ genExtJumpIfFalse, v4LongBranchDistance, 0, 0, 0, 2, 0, 1, 0, 0, 1, 0, 0, 0 },
+	{ genExtSendAbsentSelfBytecode, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0 },
 	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0 },
 	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0 },
 	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ unknownBytecode, 0, 0, 0, Nop, 2, 0, 0, 0, 0, 0, 0, 1, 0 },
 	{ callPrimitiveBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genPushRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genStoreRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genStoreAndPopRemoteTempLongBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genExtPushClosureBytecode, v4BlockCodeSize, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0 },
-	{ unknownBytecode, 0, 0, 0, Nop, 3, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genExtSendAbsentOuterBytecode, 0, 0, 0, 0, 3, 0, 0, 0, 0, 1, 0, 0, 0 },
 	{ unknownBytecode, 0, 0, 0, Nop, 3, 0, 0, 0, 0, 0, 0, 1, 0 }
 };
 static sqInt guardPageSize;
@@ -17444,6 +17448,45 @@
 }
 
 
+/*	254		 11111110	i i i i i j j j kkkkkkkk	Send To Absent Outer Literal
+	Selector #iiiii (+ Extend A * 32) with jjj (+ Extend B * 8) Arguments at
+	Depth kkkkkkkk
+ */
+
+static sqInt
+genExtSendAbsentOuterBytecode(void)
+{
+    sqInt depth;
+    sqInt litIndex;
+    sqInt nArgs;
+
+	litIndex = (((usqInt) byte1) >> 3) + (extA << 5);
+	extA = 0;
+	nArgs = (byte1 & 7) + (extB << 3);
+	extB = 0;
+	depth = byte2;
+	return genSendAbsentOuternumArgsdepth(getLiteral(litIndex), nArgs, depth);
+}
+
+
+/*	245		11110101	i i i i i j j j	Send To Absent Self Literal Selector #iiiii
+	(+ Extend A * 32) with jjj (+ Extend B * 8) Arguments
+ */
+
+static sqInt
+genExtSendAbsentSelfBytecode(void)
+{
+    sqInt litIndex;
+    sqInt nArgs;
+
+	litIndex = (((usqInt) byte1) >> 3) + (extA << 5);
+	extA = 0;
+	nArgs = (byte1 & 7) + (extB << 3);
+	extB = 0;
+	return genSendAbsentSelfnumArgs(getLiteral(litIndex), nArgs);
+}
+
+
 /*	238		11101110	i i i i i j j j	Send Literal Selector #iiiii (+ Extend A *
 	32) with jjj (+ Extend B * 8) Arguments
  */
@@ -20934,7 +20977,7 @@
 	ssAllocateCallReg(ReceiverResultReg);
 	/* begin MoveMw:r:R: */
 	genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, ReceiverResultReg);
-	marshallImplicitReceiverSendArguments(numArgs);
+	marshallAbsentReceiverSendArguments(numArgs);
 	return genMarshalledSendDynamicSupernumArgs(selector, numArgs);
 }
 
@@ -20952,11 +20995,53 @@
 	if (result != 0) {
 		return result;
 	}
-	marshallImplicitReceiverSendArguments(numArgs);
+	marshallAbsentReceiverSendArguments(numArgs);
 	return genMarshalledSendnumArgs(selector, numArgs);
 }
 
+
+/*	OK, we could do better and avoid spilling ReceiverResultReg if we
+	refactored marshallAbsentReceiverSendArguments: to take a flag saying
+	whether the
+	receiver was in ReceiverResultReg (absent receiver send) or on the stack
+	(absent dynamic super send) and in the latter case loading
+	ReceiverResultReg from the stack after marshalling. But this is a rare
+	bytecode so for the moment
+	don't bother. */
+
 static sqInt
+genSendAbsentOuternumArgsdepth(sqInt selector, sqInt numArgs, sqInt depth)
+{
+	(optStatus.isReceiverResultRegLive = 0);
+	ssAllocateCallReg(SendNumArgsReg);
+	/* begin MoveCq:R: */
+	genoperandoperand(MoveCqR, depth, SendNumArgsReg);
+	CallRT(ceEnclosingObjectTrampoline);
+	marshallAbsentReceiverSendArguments(numArgs);
+	return genMarshalledSendnumArgs(selector, numArgs);
+}
+
+
+/*	OK, we could do better and avoid spilling ReceiverResultReg if we
+	refactored marshallAbsentReceiverSendArguments: to take a flag saying
+	whether the
+	receiver was in ReceiverResultReg (absent receiver send) or on the stack
+	(absent dynamic super send) and in the latter case loading
+	ReceiverResultReg from the stack after marshalling. But this is a rare
+	bytecode so for the moment
+	don't bother. */
+
+static sqInt
+genSendAbsentSelfnumArgs(sqInt selector, sqInt numArgs)
+{
+	ssAllocateCallReg(ReceiverResultReg);
+	/* begin MoveMw:r:R: */
+	genoperandoperandoperand(MoveMwrR, FoxMFReceiver, FPReg, ReceiverResultReg);
+	marshallAbsentReceiverSendArguments(numArgs);
+	return genMarshalledSendnumArgs(selector, numArgs);
+}
+
+static sqInt
 genSendDynamicSupernumArgs(sqInt selector, sqInt numArgs)
 {
 	marshallSendArguments(numArgs);
@@ -21944,7 +22029,7 @@
 	necessary.  */
 
 static void
-marshallImplicitReceiverSendArguments(sqInt numArgs)
+marshallAbsentReceiverSendArguments(sqInt numArgs)
 {
     sqInt index;
     sqInt numSpilled;

Modified: branches/Cog/nscogsrc/vm/cogit.h
===================================================================
--- branches/Cog/nscogsrc/vm/cogit.h	2014-11-03 02:55:09 UTC (rev 3121)
+++ branches/Cog/nscogsrc/vm/cogit.h	2014-11-03 23:52:54 UTC (rev 3122)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.916 uuid: 79925bdf-769f-446f-8532-f04f0e2f11ae
+	CCodeGenerator * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
  */
 
 

Modified: branches/Cog/nscogsrc/vm/cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.c	2014-11-03 02:55:09 UTC (rev 3121)
+++ branches/Cog/nscogsrc/vm/cointerp.c	2014-11-03 23:52:54 UTC (rev 3122)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
+	CCodeGeneratorGlobalStructure * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
    from
-	CoInterpreter VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
+	CoInterpreter * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -20,8 +20,8 @@
 #endif
 
 #include <stddef.h> /* for e.g. alloca */
+#include <wchar.h>
 #include <setjmp.h>
-#include <wchar.h> /* for wint_t */
 #include "sq.h"
 #include "vmCallback.h"
 #include "sqMemoryFence.h"
@@ -463,9 +463,9 @@
 static sqInt iframeReceiver(char *theFP) NoDbgRegParms;
 static sqInt iframeSavedIP(char *theFP) NoDbgRegParms;
 void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
-sqInt implicitReceiverFormixinimplementing(sqInt rcvr, sqInt mixin, sqInt selector);
+sqInt implicitReceiverFormixinimplementing(sqInt methodReceiver, sqInt methodMixin, sqInt selector);
 usqInt instructionPointerAddress(void);
-static sqInt instructionPointerForFramecurrentFPcurrentIP(sqInt spouseFP, sqInt currentFP, sqInt instrPtr) NoDbgRegParms;
+static sqInt instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr) NoDbgRegParms;
 usqInt interpretAddress(void);
 static sqInt interpreterAllocationReserveBytes(void);
 static sqInt interpretMethodFromMachineCode(void);
@@ -1055,7 +1055,7 @@
 sqInt doSignalSemaphoreWithIndex(sqInt index);
 static void dummyReferToProxy(void);
 EXPORT(sqInt) dumpImage(sqInt fileName);
-static sqInt enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
+static sqInt enclosingObjectAtwithObjectwithMixin(sqInt depth, sqInt methodReceiver, sqInt methodMixin) NoDbgRegParms;
 static sqInt ensureCallerContext(char *theFP) NoDbgRegParms;
 static void ensureImageFormatIsUpToDate(sqInt swapBytes) NoDbgRegParms;
 static char * establishFrameForContextToReturnTo(sqInt contextToReturnTo) NoDbgRegParms;
@@ -1069,8 +1069,6 @@
 sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer);
 static sqInt fetchPointerofMarriedContext(sqInt offset, sqInt aContext) NoDbgRegParms;
 static sqInt fetchStackPointerOf(sqInt aContext) NoDbgRegParms;
-static sqInt findApplicationOfTargetMixinstartingAtBehavior(sqInt targetMixin, sqInt aBehavior) NoDbgRegParms;
-static sqInt findApplicationOfTargetMixinstartingAtNonMetaClass(sqInt targetMixin, sqInt aClass) NoDbgRegParms;
 static sqInt findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) NoDbgRegParms;
 sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr);
 static char * findFrameAboveinPage(char *theFP, StackPage *thePage) NoDbgRegParms;
@@ -1403,7 +1401,6 @@
 _iss sqInt tenuringThreshold;
 _iss sqInt forceTenureFlag;
 _iss sqInt longRunningPrimitiveCheckSequenceNumber;
-_iss sqInt methodDictLinearSearchLimit;
 _iss sqInt signalLowSpace;
 _iss usqLong statFullGCUsecs;
 _iss sqInt statFullGCs;
@@ -1419,6 +1416,7 @@
 _iss sqInt interruptKeycode;
 _iss sqInt interruptPending;
 _iss usqInt memory;
+_iss sqInt methodDictLinearSearchLimit;
 _iss usqLong nextPollUsecs;
 _iss usqLong statForceInterruptCheck;
 _iss usqLong statIGCDeltaUsecs;
@@ -2088,7 +2086,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.918";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_*_VMMaker.oscog-eem.918";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -4883,6 +4881,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l302;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4900,7 +4899,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					/* return self */
+					null;
 				l302:	/* end baseFrameReturn */;
 					goto l301;
 				}
@@ -4953,9 +4952,12 @@
 		case 126:
 			/* dynamicSuperSendBytecode */
 			{
+				sqInt aBehavior;
 				sqInt ccIndex;
 				sqInt mClassMixin;
+				sqInt mixin;
 				sqInt mixinApplication;
+				sqInt mixinApplication1;
 				sqInt rcvr;
 
 				VM_LABEL(0dynamicSuperSendBytecode);
@@ -4965,11 +4967,19 @@
 				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((byteAtPointer(++localIP)) + LiteralStart) << ShiftForWord));
 				rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
 				mClassMixin = methodClassOf(GIV(method));
-				mixinApplication = findApplicationOfTargetMixinstartingAtBehavior(mClassMixin, ((rcvr & 1)
+				/* begin findApplicationOfTargetMixin:startingAtBehavior: */
+				aBehavior = ((rcvr & 1)
 					? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
 					: (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
 							? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
-							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
+							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+				mixinApplication1 = aBehavior;
+				while (!((mixinApplication1 == GIV(nilObj))
+				 || ((mixinApplication1 == mClassMixin)
+				 || (((mixin = longAt((mixinApplication1 + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == mClassMixin)))) {
+					mixinApplication1 = longAt((mixinApplication1 + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+				}
+				mixinApplication = mixinApplication1;
 				lkupClassTag = longAt((mixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
 				goto commonSend;
 			}
@@ -5667,7 +5677,7 @@
 							goto l6;
 						}
 						if (byte3 == InstructionPointerIndex) {
-							object1 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, localIP);
+							object1 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP));
 							goto l6;
 						}
 						error("bad index");
@@ -12246,7 +12256,7 @@
 						goto l287;
 					}
 					if (index == InstructionPointerIndex) {
-						object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, localIP);
+						object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP));
 						goto l287;
 					}
 					error("bad index");
@@ -12746,11 +12756,14 @@
 		case 497: /*241*/
 			/* extSendAbsentDynamicSuperBytecode */
 			{
+				sqInt aBehavior;
 				sqInt byte;
 				sqInt ccIndex;
 				sqInt i;
 				sqInt mClassMixin;
+				sqInt mixin;
 				sqInt mixinApplication;
+				sqInt mixinApplication1;
 				sqInt oop;
 
 				VM_LABEL(0extSendAbsentDynamicSuperBytecode);
@@ -12772,11 +12785,19 @@
 				}
 				longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), longAt(localFP + FoxIFReceiver));
 				mClassMixin = methodClassOf(GIV(method));
-				mixinApplication = findApplicationOfTargetMixinstartingAtBehavior(mClassMixin, (((longAt(localFP + FoxIFReceiver)) & 1)
+				/* begin findApplicationOfTargetMixin:startingAtBehavior: */
+				aBehavior = (((longAt(localFP + FoxIFReceiver)) & 1)
 					? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
 					: (((ccIndex = (((usqInt) (longAt(longAt(localFP + FoxIFReceiver)))) >> (compactClassFieldLSB())) & 0x1F)) == 0
 							? (longAt((longAt(localFP + FoxIFReceiver)) - BaseHeaderSize)) & AllButTypeMask
-							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
+							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+				mixinApplication1 = aBehavior;
+				while (!((mixinApplication1 == GIV(nilObj))
+				 || ((mixinApplication1 == mClassMixin)
+				 || (((mixin = longAt((mixinApplication1 + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == mClassMixin)))) {
+					mixinApplication1 = longAt((mixinApplication1 + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+				}
+				mixinApplication = mixinApplication1;
 				lkupClassTag = longAt((mixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
 				goto commonSend;
 			}
@@ -12925,10 +12946,45 @@
 			}
 			break;
 		case 501: /*245*/
+			/* extSendAbsentSelfBytecode */
+			{
+				sqInt byte;
+				sqInt ccIndex;
+				sqInt classObj;
+				sqInt i;
+				sqInt oop;
+
+				VM_LABEL(0extSendAbsentSelfBytecode);
+				byte = byteAtPointer(++localIP);
+				/* begin literal: */
+				assert(GIV(method) == (iframeMethod(localFP)));
+				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + ((((((usqInt) byte) >> 3) + (extA << 5)) + LiteralStart) << ShiftForWord));
+				extA = 0;
+				GIV(argumentCount) = (byte & 7) + (extB << 3);
+				extB = 0;
+				/* begin shuffleArgumentsAndStoreAbsentReceiver: */
+
+				/* a.k.a. self internalPush: anything */
+
+				localSP -= BytesPerOop;
+				for (i = 1; i <= GIV(argumentCount); i += 1) {
+					oop = longAtPointer(localSP + (i * BytesPerOop));
+					longAtPointerput(localSP + ((i - 1) * BytesPerOop), oop);
+				}
+				longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), longAt(localFP + FoxIFReceiver));
+				/* begin classTagForClass: */
+				classObj = (((longAt(localFP + FoxIFReceiver)) & 1)
+					? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+					: (((ccIndex = (((usqInt) (longAt(longAt(localFP + FoxIFReceiver)))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+							? (longAt((longAt(localFP + FoxIFReceiver)) - BaseHeaderSize)) & AllButTypeMask
+							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+				lkupClassTag = classObj;
+				goto commonSend;
+			}
+			break;
 		case 502: /*246*/
 		case 503: /*247*/
 		case 504: /*248*/
-		case 510: /*254*/
 		case 511: /*255*/
 			/* unknownBytecode */
 			{
@@ -13046,6 +13102,47 @@
 				longAtPointerput((localSP -= BytesPerOop), newClosure);
 			}
 			break;
+		case 510: /*254*/
+			/* extSendAbsentOuterBytecode */
+			{
+				sqInt absentReceiver;
+				sqInt byte;
+				sqInt ccIndex;
+				sqInt classObj;
+				sqInt depth;
+				sqInt i;
+				sqInt oop;
+
+				VM_LABEL(0extSendAbsentOuterBytecode);
+				byte = byteAtPointer(++localIP);
+				/* begin literal: */
+				assert(GIV(method) == (iframeMethod(localFP)));
+				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + ((((((usqInt) byte) >> 3) + (extA << 5)) + LiteralStart) << ShiftForWord));
+				extA = 0;
+				GIV(argumentCount) = (byte & 7) + (extB << 3);
+				extB = 0;
+				depth = byteAtPointer(++localIP);
+				absentReceiver = enclosingObjectAtwithObjectwithMixin(depth, longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)));
+				/* begin shuffleArgumentsAndStoreAbsentReceiver: */
+
+				/* a.k.a. self internalPush: anything */
+
+				localSP -= BytesPerOop;
+				for (i = 1; i <= GIV(argumentCount); i += 1) {
+					oop = longAtPointer(localSP + (i * BytesPerOop));
+					longAtPointerput(localSP + ((i - 1) * BytesPerOop), oop);
+				}
+				longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), absentReceiver);
+				/* begin classTagForClass: */
+				classObj = ((absentReceiver & 1)
+					? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+					: (((ccIndex = (((usqInt) (longAt(absentReceiver))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+							? (longAt(absentReceiver - BaseHeaderSize)) & AllButTypeMask
+							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+				lkupClassTag = classObj;
+				goto commonSend;
+			}
+			break;
 		}
 	}
 
@@ -14178,6 +14275,7 @@
 sqInt
 ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aBehavior;
     sqInt ccIndex;
     sqInt classTag;
     CogMethod *cogMethod;
@@ -14186,7 +14284,9 @@
     sqInt mClassMixin;
     sqInt methodHeader;
     sqInt methodHeader1;
+    sqInt mixin;
     sqInt mixinApplication;
+    sqInt mixinApplication1;
     CogMethod *newCogMethod;
     sqInt top;
     sqInt top1;
@@ -14200,11 +14300,19 @@
 	/* begin sendBreakpoint:receiver: */
 	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr);
 	mClassMixin = methodClassOf(((mframeHomeMethod(GIV(framePointer)))->methodObject));
-	mixinApplication = findApplicationOfTargetMixinstartingAtBehavior(mClassMixin, ((rcvr & 1)
+	/* begin findApplicationOfTargetMixin:startingAtBehavior: */
+	aBehavior = ((rcvr & 1)
 		? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
 		: (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
 				? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
-				: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
+				: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+	mixinApplication1 = aBehavior;
+	while (!((mixinApplication1 == GIV(nilObj))
+	 || ((mixinApplication1 == mClassMixin)
+	 || (((mixin = longAt((mixinApplication1 + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == mClassMixin)))) {
+		mixinApplication1 = longAt((mixinApplication1 + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+	}
+	mixinApplication = mixinApplication1;
 	assert((lengthOf(mixinApplication)) > (InstanceSpecificationIndex + 1));
 	classTag = longAt((mixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
 	GIV(argumentCount) = numArgs;
@@ -16607,245 +16715,143 @@
 }
 
 
-/*	This is used to implement the innards of the pushImplicitReceiverBytecode,
-	used for implicit receiver sends in NS2/NS3. Find the nearest
-	lexically-enclosing implementation of selector by searching up the static
-	chain of anObject,
-	starting at mixin's application. This is an iterative implementation
+/*	This is used to implement implicit receiver sends in Newspeak. Find the
+	nearest lexically-enclosing implementation of selector by searching up the
+	static chain of the
+	method's receiver, starting at mixin's application. This implementation is
 	derived from
 	
-	<ContextPart> implicitReceiverFor: obj <Object>
-	withMixin: mixin <Mixin>
+	<ContextPart> implicitReceiverFor: methodReceiver <Object>
+	in: methodMixin <Mixin>
 	implementing: selector <Symbol> ^<Object> */
-/*	This is used to implement the innards of the pushImplicitReceiverBytecode,
-	used for implicit receiver sends in NS2/NS3. Find the nearest
-	lexically-enclosing implementation of selector by searching up the static
-	chain of anObject,
-	starting at mixin's application. This is an iterative implementation
+/*	This is used to implement implicit receiver sends in Newspeak. Find the
+	nearest lexically-enclosing implementation of selector by searching up the
+	static chain of the
+	method's receiver, starting at mixin's application. This implementation is
 	derived from
 	
-	<ContextPart> implicitReceiverFor: obj <Object>
-	withMixin: mixin <Mixin>
+	<ContextPart> implicitReceiverFor: methodReceiver <Object>
+	in: methodMixin <Mixin>
 	implementing: selector <Symbol> ^<Object> */
 
 sqInt
-implicitReceiverFormixinimplementing(sqInt rcvr, sqInt mixin, sqInt selector)
+implicitReceiverFormixinimplementing(sqInt methodReceiver, sqInt methodMixin, sqInt selector)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aBehavior;
+    sqInt candidateMixin;
+    sqInt candidateMixinApplication;
+    sqInt candidateReceiver;
     sqInt ccIndex;
-    sqInt ccIndex1;
     sqInt dictionary;
-    sqInt dictionary1;
     sqInt found;
-    sqInt found1;
     sqInt header;
-    sqInt header1;
-    sqInt implicitReceiver;
-    sqInt implicitReceiverOrNil;
     sqInt index;
-    sqInt index1;
     sqInt length;
-    sqInt length1;
     sqInt mask;
-    sqInt mask1;
     sqInt methodArray;
-    sqInt methodArray1;
+    sqInt mixin;
     sqInt mixinApplication;
-    sqInt mixinApplication1;
     sqInt nextSelector;
-    sqInt nextSelector1;
     sqInt sz;
-    sqInt sz1;
-    sqInt targetMixin;
-    sqInt theMixin;
-    sqInt theMixin1;
     sqInt wrapAround;
-    sqInt wrapAround1;
 
 	if (breakOnImplicitReceiver()) {
 		/* begin sendBreakpoint:receiver: */
 		sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), null);
 	}
-	assert(!((isOopForwarded(rcvr))));
-	assert(!((isForwarded(mixin))));
+	assert(!((isOopForwarded(methodReceiver))));
+	assert(!((isForwarded(methodMixin))));
 	GIV(messageSelector) = selector;
-	mixinApplication = findApplicationOfTargetMixinstartingAtBehavior(mixin, ((rcvr & 1)
-		? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
-		: (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
-				? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
-				: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
-	if (mixinApplication == GIV(nilObj)) {
-		return rcvr;
-	}
-	dictionary = longAt((mixinApplication + BaseHeaderSize) + (MethodDictionaryIndex << ShiftForWord));
-	/* begin lookupMethodInDictionary: */
-	/* begin numSlotsOf: */
-	header = longAt(dictionary);
-	sz = ((header & TypeMask) == HeaderTypeSizeAndClass
-		? (longAt(dictionary - (BytesPerWord * 2))) & AllButTypeMask
-		: header & SizeMask);
-	length = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
+	candidateReceiver = methodReceiver;
+	candidateMixin = methodMixin;
+	while (1) {
+		/* begin findApplicationOfTargetMixin:startingAtBehavior: */
+		aBehavior = ((candidateReceiver & 1)
+			? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
+			: (((ccIndex = (((usqInt) (longAt(candidateReceiver))) >> (compactClassFieldLSB())) & 0x1F)) == 0
+					? (longAt(candidateReceiver - BaseHeaderSize)) & AllButTypeMask
+					: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+		mixinApplication = aBehavior;
+		while (!((mixinApplication == GIV(nilObj))
+		 || ((mixinApplication == candidateMixin)
+		 || (((mixin = longAt((mixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == candidateMixin)))) {
+			mixinApplication = longAt((mixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+		}
+		candidateMixinApplication = mixinApplication;
+		assert(!((candidateMixinApplication == (nilObject()))));
+		dictionary = longAt((candidateMixinApplication + BaseHeaderSize) + (MethodDictionaryIndex << ShiftForWord));
+		/* begin lookupMethodInDictionary: */
+		/* begin numSlotsOf: */
+		header = longAt(dictionary);
+		sz = ((header & TypeMask) == HeaderTypeSizeAndClass
+			? (longAt(dictionary - (BytesPerWord * 2))) & AllButTypeMask
+			: header & SizeMask);
+		length = ((usqInt) (sz - BaseHeaderSize)) >> ShiftForWord;
 
-	/* Use linear search on small dictionaries; its cheaper.
-	   Also the limit can be set to force linear search of all dictionaries, which supports the
-	   booting of images that need rehashing (e.g. because a tracer has generated an image
-	   with different hashes but hasn't rehashed it yet.) */
+		/* Use linear search on small dictionaries; its cheaper.
+		   Also the limit can be set to force linear search of all dictionaries, which supports the
+		   booting of images that need rehashing (e.g. because a tracer has generated an image
+		   with different hashes but hasn't rehashed it yet.) */
 
-	mask = (length - SelectorStart) - 1;
-	if (mask <= GIV(methodDictLinearSearchLimit)) {
-		index = 0;
-		while (index <= mask) {
-			nextSelector = longAt((dictionary + BaseHeaderSize) + ((index + SelectorStart) << ShiftForWord));
-			
-			if (nextSelector == GIV(messageSelector)) {
-				methodArray = longAt((dictionary + BaseHeaderSize) + (MethodArrayIndex << ShiftForWord));
-				GIV(newMethod) = longAt((methodArray + BaseHeaderSize) + (index << ShiftForWord));
-				found = 1;
-				goto l1;
+		mask = (length - SelectorStart) - 1;
+		if (mask <= GIV(methodDictLinearSearchLimit)) {
+			index = 0;
+			while (index <= mask) {
+				nextSelector = longAt((dictionary + BaseHeaderSize) + ((index + SelectorStart) << ShiftForWord));
+				
+				if (nextSelector == GIV(messageSelector)) {
+					methodArray = longAt((dictionary + BaseHeaderSize) + (MethodArrayIndex << ShiftForWord));
+					GIV(newMethod) = longAt((methodArray + BaseHeaderSize) + (index << ShiftForWord));
+					found = 1;
+					goto l1;
+				}
+				index += 1;
 			}
-			index += 1;
+			found = 0;
+			goto l1;
 		}
-		found = 0;
-		goto l1;
-	}
 
-	/* It is assumed that there are some nils in this dictionary, and search will
-	   stop when one is encountered. However, if there are no nils, then wrapAround
-	   will be detected the second time the loop gets to the end of the table. */
+		/* It is assumed that there are some nils in this dictionary, and search will
+		   stop when one is encountered. However, if there are no nils, then wrapAround
+		   will be detected the second time the loop gets to the end of the table. */
 
-	index = SelectorStart + (mask & (((GIV(messageSelector) & 1)
+		index = SelectorStart + (mask & (((GIV(messageSelector) & 1)
 	? (GIV(messageSelector) >> 1)
 	: (((usqInt) (longAt(GIV(messageSelector)))) >> HashBitsOffset) & HashMaskUnshifted)));
-	wrapAround = 0;
-	while (1) {
-		nextSelector = longAt((dictionary + BaseHeaderSize) + (index << ShiftForWord));
-		if (nextSelector == GIV(nilObj)) {
-			found = 0;
-			goto l1;
-		}
-		
-		if (nextSelector == GIV(messageSelector)) {
-			methodArray = longAt((dictionary + BaseHeaderSize) + (MethodArrayIndex << ShiftForWord));
-			GIV(newMethod) = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << ShiftForWord));
-			found = 1;
-			goto l1;
-		}
-		index += 1;
-		if (index == length) {
-			if (wrapAround) {
+		wrapAround = 0;
+		while (1) {
+			nextSelector = longAt((dictionary + BaseHeaderSize) + (index << ShiftForWord));
+			if (nextSelector == GIV(nilObj)) {
 				found = 0;
 				goto l1;
 			}
-			wrapAround = 1;
-			index = SelectorStart;
-		}
-	}
-	found = 0;
-l1:	/* end lookupMethodInDictionary: */;
-	if (!found) {
-		theMixin = longAt((mixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord));
-		/* begin nextImplicitReceiverFor:withMixin: */
-		assert(!((isOopForwarded(longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord))))));
-		assert(!((isForwarded(longAt((theMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord))))));
-		implicitReceiver = longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
-		targetMixin = longAt((theMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
-		while (1) {
-			if (targetMixin == GIV(nilObj)) {
-
-				/* or: [implicitReceiver = objectMemory nilObject] */
-
-				implicitReceiverOrNil = GIV(nilObj);
-				goto l3;
+			
+			if (nextSelector == GIV(messageSelector)) {
+				methodArray = longAt((dictionary + BaseHeaderSize) + (MethodArrayIndex << ShiftForWord));
+				GIV(newMethod) = longAt((methodArray + BaseHeaderSize) + ((index - SelectorStart) << ShiftForWord));
+				found = 1;
+				goto l1;
 			}
-			mixinApplication1 = findApplicationOfTargetMixinstartingAtNonMetaClass(targetMixin, ((implicitReceiver & 1)
-				? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
-				: (((ccIndex1 = (((usqInt) (longAt(implicitReceiver))) >> (compactClassFieldLSB())) & 0x1F)) == 0
-						? (longAt(implicitReceiver - BaseHeaderSize)) & AllButTypeMask
-						: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex1 - 1) << ShiftForWord)))));
-			if (mixinApplication1 == GIV(nilObj)) {
-				implicitReceiverOrNil = GIV(nilObj);
-				goto l3;
-			}
-			dictionary1 = longAt((mixinApplication1 + BaseHeaderSize) + (MethodDictionaryIndex << ShiftForWord));
-			/* begin lookupMethodInDictionary: */
-			/* begin numSlotsOf: */
-			header1 = longAt(dictionary1);
-			sz1 = ((header1 & TypeMask) == HeaderTypeSizeAndClass
-				? (longAt(dictionary1 - (BytesPerWord * 2))) & AllButTypeMask
-				: header1 & SizeMask);
-			length1 = ((usqInt) (sz1 - BaseHeaderSize)) >> ShiftForWord;
-
-			/* Use linear search on small dictionaries; its cheaper.
-			   Also the limit can be set to force linear search of all dictionaries, which supports the
-			   booting of images that need rehashing (e.g. because a tracer has generated an image
-			   with different hashes but hasn't rehashed it yet.) */
-
-			mask1 = (length1 - SelectorStart) - 1;
-			if (mask1 <= GIV(methodDictLinearSearchLimit)) {
-				index1 = 0;
-				while (index1 <= mask1) {
-					nextSelector1 = longAt((dictionary1 + BaseHeaderSize) + ((index1 + SelectorStart) << ShiftForWord));
-					
-					if (nextSelector1 == GIV(messageSelector)) {
-						methodArray1 = longAt((dictionary1 + BaseHeaderSize) + (MethodArrayIndex << ShiftForWord));
-						GIV(newMethod) = longAt((methodArray1 + BaseHeaderSize) + (index1 << ShiftForWord));
-						found1 = 1;
-						goto l2;
-					}
-					index1 += 1;
+			index += 1;
+			if (index == length) {
+				if (wrapAround) {
+					found = 0;
+					goto l1;
 				}
-				found1 = 0;
-				goto l2;
+				wrapAround = 1;
+				index = SelectorStart;
 			}
-
-			/* It is assumed that there are some nils in this dictionary, and search will
-			   stop when one is encountered. However, if there are no nils, then wrapAround
-			   will be detected the second time the loop gets to the end of the table. */
-
-			index1 = SelectorStart + (mask1 & (((GIV(messageSelector) & 1)
-	? (GIV(messageSelector) >> 1)
-	: (((usqInt) (longAt(GIV(messageSelector)))) >> HashBitsOffset) & HashMaskUnshifted)));
-			wrapAround1 = 0;
-			while (1) {
-				nextSelector1 = longAt((dictionary1 + BaseHeaderSize) + (index1 << ShiftForWord));
-				if (nextSelector1 == GIV(nilObj)) {
-					found1 = 0;
-					goto l2;
-				}
-				
-				if (nextSelector1 == GIV(messageSelector)) {
-					methodArray1 = longAt((dictionary1 + BaseHeaderSize) + (MethodArrayIndex << ShiftForWord));
-					GIV(newMethod) = longAt((methodArray1 + BaseHeaderSize) + ((index1 - SelectorStart) << ShiftForWord));
-					found1 = 1;
-					goto l2;
-				}
-				index1 += 1;
-				if (index1 == length1) {
-					if (wrapAround1) {
-						found1 = 0;
-						goto l2;
-					}
-					wrapAround1 = 1;
-					index1 = SelectorStart;
-				}
-			}
-			found1 = 0;
-		l2:	/* end lookupMethodInDictionary: */;
-			if (found1) break;
-			implicitReceiver = longAt((mixinApplication1 + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
-			theMixin1 = longAt((mixinApplication1 + BaseHeaderSize) + (MixinIndex << ShiftForWord));
-			if (theMixin1 == GIV(nilObj)) {
-				implicitReceiverOrNil = GIV(nilObj);
-				goto l3;
-			}
-			targetMixin = longAt((theMixin1 + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
 		}
-		implicitReceiverOrNil = implicitReceiver;
-	l3:	/* end nextImplicitReceiverFor:withMixin: */;
-		if (implicitReceiverOrNil != GIV(nilObj)) {
-			return implicitReceiverOrNil;
+		found = 0;
+	l1:	/* end lookupMethodInDictionary: */;
+		if (found) {
+			return candidateReceiver;
 		}
+		candidateMixin = longAt((candidateMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
+		if (candidateMixin == GIV(nilObj)) break;
+		candidateReceiver = longAt((candidateMixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
 	}
-	return rcvr;
+	return methodReceiver;
 }
 
 usqInt
@@ -16867,14 +16873,14 @@
 	mapped to a bytecode pc. */
 
 static sqInt
-instructionPointerForFramecurrentFPcurrentIP(sqInt spouseFP, sqInt currentFP, sqInt instrPtr)
+instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     char *callerFP;
     char *fp;
     sqInt index;
-    char * theFPAbove;
+    char *theFPAbove;
     sqInt theIP;
-    StackPage * thePage;
+    StackPage *thePage;
     sqInt value;
 
 	if (spouseFP == currentFP) {
@@ -44553,35 +44559,40 @@
 }
 
 
-/*	This is used to implement the innards of the pushEnclosingObjectBytecode,
-	used for explicit outer sends in NS2/NS3.  */
+/*	This is used to implement outer sends and outer expressions in Newspeak. */
 
 static sqInt
-enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin)
+enclosingObjectAtwithObjectwithMixin(sqInt depth, sqInt methodReceiver, sqInt methodMixin)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
+    sqInt aBehavior;
     sqInt ccIndex;
     sqInt count;
     sqInt enclosingObject;
+    sqInt mixin;
     sqInt mixinApplication;
+    sqInt mixinApplication1;
     sqInt targetMixin;
 
-	enclosingObject = anObject;
-	targetMixin = mixin;
+	enclosingObject = methodReceiver;
+	targetMixin = methodMixin;
 	count = 0;
-	while (count < n) {
+	while (count < depth) {
 		count += 1;
-		if ((targetMixin == GIV(nilObj))
-		 || (enclosingObject == GIV(nilObj))) {
-			return GIV(nilObj);
-		}
-		mixinApplication = findApplicationOfTargetMixinstartingAtNonMetaClass(targetMixin, ((enclosingObject & 1)
+		assert(!((targetMixin == (nilObject()))));
+		/* begin findApplicationOfTargetMixin:startingAtBehavior: */
+		aBehavior = ((enclosingObject & 1)
 			? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
 			: (((ccIndex = (((usqInt) (longAt(enclosingObject))) >> (compactClassFieldLSB())) & 0x1F)) == 0
 					? (longAt(enclosingObject - BaseHeaderSize)) & AllButTypeMask
-					: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
-		if (mixinApplication == GIV(nilObj)) {
-			return GIV(nilObj);
+					: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+		mixinApplication1 = aBehavior;
+		while (!((mixinApplication1 == GIV(nilObj))
+		 || ((mixinApplication1 == targetMixin)
+		 || (((mixin = longAt((mixinApplication1 + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == targetMixin)))) {
+			mixinApplication1 = longAt((mixinApplication1 + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
 		}
+		mixinApplication = mixinApplication1;
+		assert(!((mixinApplication == (nilObject()))));
 		enclosingObject = longAt((mixinApplication + BaseHeaderSize) + (EnclosingObjectIndex << ShiftForWord));
 		targetMixin = longAt((targetMixin + BaseHeaderSize) + (EnclosingMixinIndex << ShiftForWord));
 	}
@@ -45341,62 +45352,7 @@
 	return (sp >> 1);
 }
 
-
-/*	This is used to implement the innards of the pushImplicitReceiverBytecode,
-	used for outer sends in NS2/NS3. Find the MixinApplcation of which
-	aBehavior is a subclass that is an application of targetMixin. This is an
-	implementation derived from
-	
-	<ContextPart> findApplicationOfTargetMixin: targetMixin
-	startingAtBehavior: aBehavior
-	 */
-
 static sqInt
-findApplicationOfTargetMixinstartingAtBehavior(sqInt targetMixin, sqInt aBehavior)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt ccIndex;
-    sqInt mixin;
-    sqInt mixinOrMixinApplication;
-
-	mixinOrMixinApplication = aBehavior;
-	while (!((mixinOrMixinApplication == GIV(nilObj))
-	 || ((mixinOrMixinApplication == targetMixin)
-	 || ((((mixin = longAt((mixinOrMixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == targetMixin)
-	 || (((((ccIndex = (((usqInt) (longAt(mixin))) >> (compactClassFieldLSB())) & 0x1F)) == 0
-	? (longAt(mixin - BaseHeaderSize)) & AllButTypeMask
-	: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))) == targetMixin))))) {
-		mixinOrMixinApplication = longAt((mixinOrMixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
-	}
-	return mixinOrMixinApplication;
-}
-
-
-/*	This is used to implement the innards of the pushImplicitReceiverBytecode,
-	used for outer sends in NS2/NS3. Find the MixinApplcation of which aClass
-	is a subclass that is an application of targetMixin. This is an
-	implementation derived from
-	
-	<ContextPart> findApplicationOfTargetMixin: targetMixin
-	startingAtNonMetaClass: aClass
-	 */
-
-static sqInt
-findApplicationOfTargetMixinstartingAtNonMetaClass(sqInt targetMixin, sqInt aClass)
-{   DECL_MAYBE_SQ_GLOBAL_STRUCT
-    sqInt mixinOrMixinApplication;
-
-	assert(!((isForwarded(targetMixin))));
-	assert(!((isForwarded(aClass))));
-	mixinOrMixinApplication = aClass;
-	while (!((mixinOrMixinApplication == GIV(nilObj))
-	 || ((mixinOrMixinApplication == targetMixin)
-	 || ((longAt((mixinOrMixinApplication + BaseHeaderSize) + (MixinIndex << ShiftForWord))) == targetMixin)))) {
-		mixinOrMixinApplication = longAt((mixinOrMixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
-	}
-	return mixinOrMixinApplication;
-}
-
-static sqInt
 findClassContainingMethodstartingAt(sqInt meth, sqInt classObj)
 {   DECL_MAYBE_SQ_GLOBAL_STRUCT
     sqInt classDict;

Modified: branches/Cog/nscogsrc/vm/cointerp.h
===================================================================
--- branches/Cog/nscogsrc/vm/cointerp.h	2014-11-03 02:55:09 UTC (rev 3121)
+++ branches/Cog/nscogsrc/vm/cointerp.h	2014-11-03 23:52:54 UTC (rev 3122)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
+	CCodeGeneratorGlobalStructure * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
  */
 
 
@@ -64,7 +64,7 @@
 void (*functionPointerForCompiledMethodprimitiveIndex(sqInt methodObj, sqInt primIndex))(void) ;
 sqInt getCheckAllocFiller(void);
 void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
-sqInt implicitReceiverFormixinimplementing(sqInt rcvr, sqInt mixin, sqInt selector);
+sqInt implicitReceiverFormixinimplementing(sqInt methodReceiver, sqInt methodMixin, sqInt selector);
 usqInt instructionPointerAddress(void);
 usqInt interpretAddress(void);
 sqInt isCogMethodReference(sqInt methodHeader);

Modified: branches/Cog/nscogsrc/vm/gcc3x-cointerp.c
===================================================================
--- branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-11-03 02:55:09 UTC (rev 3121)
+++ branches/Cog/nscogsrc/vm/gcc3x-cointerp.c	2014-11-03 23:52:54 UTC (rev 3122)
@@ -2,11 +2,11 @@
 
 
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
+	CCodeGeneratorGlobalStructure * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
    from
-	CoInterpreter VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
+	CoInterpreter * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8 " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter * VMMaker.oscog-eem.918 uuid: 17402dc7-cd8d-4656-8ec9-a74c22c85ac8 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -23,8 +23,8 @@
 #endif
 
 #include <stddef.h> /* for e.g. alloca */
+#include <wchar.h>
 #include <setjmp.h>
-#include <wchar.h> /* for wint_t */
 #include "sqGnu.h"
 #include "vmCallback.h"
 #include "sqMemoryFence.h"
@@ -466,9 +466,9 @@
 static sqInt iframeReceiver(char *theFP) NoDbgRegParms;
 static sqInt iframeSavedIP(char *theFP) NoDbgRegParms;
 void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
-sqInt implicitReceiverFormixinimplementing(sqInt rcvr, sqInt mixin, sqInt selector);
+sqInt implicitReceiverFormixinimplementing(sqInt methodReceiver, sqInt methodMixin, sqInt selector);
 usqInt instructionPointerAddress(void);
-static sqInt instructionPointerForFramecurrentFPcurrentIP(sqInt spouseFP, sqInt currentFP, sqInt instrPtr) NoDbgRegParms;
+static sqInt instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr) NoDbgRegParms;
 usqInt interpretAddress(void);
 static sqInt interpreterAllocationReserveBytes(void);
 static sqInt interpretMethodFromMachineCode(void);
@@ -1058,7 +1058,7 @@
 sqInt doSignalSemaphoreWithIndex(sqInt index);
 static void dummyReferToProxy(void);
 EXPORT(sqInt) dumpImage(sqInt fileName);
-static sqInt enclosingObjectAtwithObjectwithMixin(sqInt n, sqInt anObject, sqInt mixin) NoDbgRegParms;
+static sqInt enclosingObjectAtwithObjectwithMixin(sqInt depth, sqInt methodReceiver, sqInt methodMixin) NoDbgRegParms;
 static sqInt ensureCallerContext(char *theFP) NoDbgRegParms;
 static void ensureImageFormatIsUpToDate(sqInt swapBytes) NoDbgRegParms;
 static char * establishFrameForContextToReturnTo(sqInt contextToReturnTo) NoDbgRegParms;
@@ -1072,8 +1072,6 @@
 sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer);
 static sqInt fetchPointerofMarriedContext(sqInt offset, sqInt aContext) NoDbgRegParms;
 static sqInt fetchStackPointerOf(sqInt aContext) NoDbgRegParms;
-static sqInt findApplicationOfTargetMixinstartingAtBehavior(sqInt targetMixin, sqInt aBehavior) NoDbgRegParms;
-static sqInt findApplicationOfTargetMixinstartingAtNonMetaClass(sqInt targetMixin, sqInt aClass) NoDbgRegParms;
 static sqInt findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) NoDbgRegParms;
 sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr);
 static char * findFrameAboveinPage(char *theFP, StackPage *thePage) NoDbgRegParms;
@@ -1406,7 +1404,6 @@
 _iss sqInt tenuringThreshold;
 _iss sqInt forceTenureFlag;
 _iss sqInt longRunningPrimitiveCheckSequenceNumber;
-_iss sqInt methodDictLinearSearchLimit;
 _iss sqInt signalLowSpace;
 _iss usqLong statFullGCUsecs;
 _iss sqInt statFullGCs;
@@ -1422,6 +1419,7 @@
 _iss sqInt interruptKeycode;
 _iss sqInt interruptPending;
 _iss usqInt memory;
+_iss sqInt methodDictLinearSearchLimit;
 _iss usqLong nextPollUsecs;
 _iss usqLong statForceInterruptCheck;
 _iss usqLong statIGCDeltaUsecs;
@@ -2091,7 +2089,7 @@
 	/* 574 */ (void (*)(void))0,
 	/* 575 */ (void (*)(void))0,
  0 };
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.918";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_*_VMMaker.oscog-eem.918";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -4892,6 +4890,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
+							null;
 							goto l302;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
@@ -4909,7 +4908,7 @@
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-					/* return self */
+					null;
 				l302:	/* end baseFrameReturn */;
 					goto l301;
 				}
@@ -4962,9 +4961,12 @@
 		CASE(126)
 			/* dynamicSuperSendBytecode */
 			{
+				sqInt aBehavior;
 				sqInt ccIndex;
 				sqInt mClassMixin;
+				sqInt mixin;
 				sqInt mixinApplication;
+				sqInt mixinApplication1;
 				sqInt rcvr;
 
 				VM_LABEL(0dynamicSuperSendBytecode);
@@ -4974,11 +4976,19 @@
 				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((byteAtPointer(++localIP)) + LiteralStart) << ShiftForWord));
 				rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
 				mClassMixin = methodClassOf(GIV(method));
-				mixinApplication = findApplicationOfTargetMixinstartingAtBehavior(mClassMixin, ((rcvr & 1)
+				/* begin findApplicationOfTargetMixin:startingAtBehavior: */
+				aBehavior = ((rcvr & 1)
 					? longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (ClassSmallInteger << ShiftForWord))
 					: (((ccIndex = (((usqInt) (longAt(rcvr))) >> (compactClassFieldLSB())) & 0x1F)) == 0
 							? (longAt(rcvr - BaseHeaderSize)) & AllButTypeMask
-							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord)))));
+							: longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (CompactClasses << ShiftForWord))) + BaseHeaderSize) + ((ccIndex - 1) << ShiftForWord))));
+				mixinApplication1 = aBehavior;
+				while (!((mixinApplication1 == GIV(nilObj))
+				 || ((mixinApplication1 == mClassMixin)
+				 || (((mixin = longAt((mixinApplication1 + BaseHeaderSize) + (MixinIndex << ShiftForWord)))) == mClassMixin)))) {
+					mixinApplication1 = longAt((mixinApplication1 + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
+				}
+				mixinApplication = mixinApplication1;
 				lkupClassTag = longAt((mixinApplication + BaseHeaderSize) + (SuperclassIndex << ShiftForWord));
 				goto commonSend;
 			}
@@ -5676,7 +5686,7 @@
 							goto l6;
 						}
 						if (byte3 == InstructionPointerIndex) {
-							object1 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, localIP);
+							object1 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP));
 							goto l6;
 						}
 						error("bad index");
@@ -12255,7 +12265,7 @@
 						goto l287;
 					}
 					if (index == InstructionPointerIndex) {
-						object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, localIP);
+						object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP));
 						goto l287;
 					}
 					error("bad index");
@@ -12755,11 +12765,14 @@
 		CASE(497) /*241*/
 			/* extSendAbsentDynamicSuperBytecode */
 			{
+				sqInt aBehavior;
 				sqInt byte;
 				sqInt ccIndex;
 				sqInt i;
 				sqInt mClassMixin;
+				sqInt mixin;
 				sqInt mixinApplication;

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list