[Vm-dev] [commit][3389] CogVM source as per VMMaker.oscog-eem.1380

commits at squeakvm.org commits at squeakvm.org
Thu Jun 25 20:55:17 UTC 2015


Revision: 3389
Author:   eliot
Date:     2015-06-25 13:55:14 -0700 (Thu, 25 Jun 2015)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1380

Newspeak:
Enforce Newspeak access control in the interpreter, and enable it in Stack VMs.
Add a separate global lookup cache for non-ordinary sends.
Do proper lookups for self and super send misses from cogged code.
Do proper lookups for implicit receiver and outer send misses from cogged code.

Spur:
Add explicit read barriers to primitives which access an argument as the
receiver (i.e. the mirror primitives).  Don't check if the actual receiver is
used.  Simplify failure where appropriate because primitives will be retried.
Fix bogus assert in extSendBytecode.  Simplify
SpurMemoryManager>>classForClassTag:; its assert is superfluous.

General:
Eliminate a double method cache flush on startrup.

Sista Cogit:
Fix the #== bug that was crashing the VM when the counter trips in some methods.
Interesting register hack to avoid 1 move instruction in #== with forwarders.
Slighlty change the code generation of #== in sista Jit to reduce the estimated
size of abstract opcodes. The sista Jit uses 11 in instead of 10 in the regular
jit due to the counter logic, but much better than the previous value of 14.

ARM Cogit:
Fix PIC parsing for out-of-line literals.  Add an assert to the closed PIC
prototype code to check all PIC parameters are accessible.  Add a
containsAddress: to abstract away the test for a target within the PIC.

Modified Paths:
--------------
    branches/Cog/nsspursrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.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/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/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/nsspursrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c
===================================================================
--- branches/Cog/nsspursrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c	2015-06-23 17:57:36 UTC (rev 3388)
+++ branches/Cog/nsspursrc/plugins/MiscPrimitivePlugin/MiscPrimitivePlugin.c	2015-06-25 20:55:14 UTC (rev 3389)
@@ -1,16 +1,16 @@
 /* Automatically generated by
-	VMPluginCodeGenerator VMMaker.oscog-eem.1325 uuid: a0bb0f7f-5e6e-48a7-bf73-fa5d135e06c0
+	VMPluginCodeGenerator * VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8
    from
-	MiscPrimitivePlugin VMMaker.oscog-eem.1325 uuid: a0bb0f7f-5e6e-48a7-bf73-fa5d135e06c0
+	MiscPrimitivePlugin * VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8
 	Bitmap * Graphics-mt.313 uuid: 99af1adc-65b3-5549-8d10-ab452e0c59e5
-	ByteArray * Collections.spur-ul.610, Collections.spur-ul.627, Collections.spur-mt.631, Collections.spur-mt.635 uuid: 3448b17a-1361-47a8-af38-4c26b42dc028
-	ByteString * Collections.spur-ul.610, Collections.spur-ul.627, Collections.spur-mt.631, Collections.spur-mt.635 uuid: 3448b17a-1361-47a8-af38-4c26b42dc028
+	ByteArray * Collections.spur-eem.636 uuid: b341b330-e1ef-455e-9880-7b782cc4f014
+	ByteString * Collections.spur-eem.636 uuid: b341b330-e1ef-455e-9880-7b782cc4f014
 	SampledSound Sound-topa.43 uuid: c1c2b948-6c86-4cf8-877d-1620433f558e
  */
-static char __buildInfo[] = "MiscPrimitivePlugin VMMaker.oscog-eem.1325 uuid: a0bb0f7f-5e6e-48a7-bf73-fa5d135e06c0\n\
+static char __buildInfo[] = "MiscPrimitivePlugin * VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8\n\
 Bitmap * Graphics-mt.313 uuid: 99af1adc-65b3-5549-8d10-ab452e0c59e5\n\
-ByteArray * Collections.spur-ul.610, Collections.spur-ul.627, Collections.spur-mt.631, Collections.spur-mt.635 uuid: 3448b17a-1361-47a8-af38-4c26b42dc028\n\
-ByteString * Collections.spur-ul.610, Collections.spur-ul.627, Collections.spur-mt.631, Collections.spur-mt.635 uuid: 3448b17a-1361-47a8-af38-4c26b42dc028\n\
+ByteArray * Collections.spur-eem.636 uuid: b341b330-e1ef-455e-9880-7b782cc4f014\n\
+ByteString * Collections.spur-eem.636 uuid: b341b330-e1ef-455e-9880-7b782cc4f014\n\
 SampledSound Sound-topa.43 uuid: c1c2b948-6c86-4cf8-877d-1620433f558e " __DATE__ ;
 
 
@@ -90,9 +90,9 @@
 struct VirtualMachine* interpreterProxy;
 static const char *moduleName =
 #ifdef SQUEAK_BUILTIN_PLUGIN
-	"MiscPrimitivePlugin VMMaker.oscog-eem.1325 (i)"
+	"MiscPrimitivePlugin * VMMaker.oscog-cb.1379 (i)"
 #else
-	"MiscPrimitivePlugin VMMaker.oscog-eem.1325 (e)"
+	"MiscPrimitivePlugin * VMMaker.oscog-cb.1379 (e)"
 #endif
 ;
 

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-06-23 17:57:36 UTC (rev 3388)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-06-25 20:55:14 UTC (rev 3389)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1371 uuid: a51022d9-e5d7-4dbf-83d3-4326bd5ea61f
+	CCodeGenerator VMMaker.oscog-eem.1380 uuid: 582c96d5-f95a-4916-a11d-62c452accc31
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-23 17:57:36 UTC (rev 3388)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-25 20:55:14 UTC (rev 3389)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
+	CCodeGenerator VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
+	StackToRegisterMappingCogit VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -270,7 +270,7 @@
 #define MaxStackCheckOffset 0xFFF
 #define MaxX2NDisplacement 992
 #define MethodCacheClass 2
-#define MethodCacheMask 0xFFC
+#define MethodCacheMask 0x7FC
 #define MethodCacheMethod 3
 #define MethodCacheSelector 1
 #define MethodIndex 3
@@ -1202,6 +1202,7 @@
 static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) NoDbgRegParms;
 static sqInt v3or4PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) NoDbgRegParms;
 static sqInt v3or4NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
+static sqInt unreachable(void);
 
 
 /*** Variables ***/
@@ -7967,10 +7968,12 @@
 	annotation = annotationForMcpcin(outerReturn, callerMethod);
 	assert(annotation >= IsSendCall);
 	if (annotation == IsNSSelfSend) {
-		return ceSelfSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		ceSelfSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		unreachable();
 	}
 	if (annotation == IsNSDynamicSuperSend) {
-		return ceDynamicSuperSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		ceDynamicSuperSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		unreachable();
 	}
 
 	assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint);
@@ -10686,12 +10689,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;
 
@@ -28338,3 +28341,10 @@
 				? 1
 				: 0));
 }
+
+	/* VMClass>>#unreachable */
+static sqInt
+unreachable(void)
+{
+	error("UNREACHABLE");
+}

Modified: branches/Cog/nsspursrc/vm/cogitIA32.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-23 17:57:36 UTC (rev 3388)
+++ branches/Cog/nsspursrc/vm/cogitIA32.c	2015-06-25 20:55:14 UTC (rev 3389)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
+	CCodeGenerator VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47
+	StackToRegisterMappingCogit VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1367 uuid: 5d5685bb-29fe-4d36-8ff2-df498dd8cc47 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-cb.1379 uuid: cc44db6e-5fe4-4aee-9a1b-e6de870b83a8 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -266,7 +266,7 @@
 #define MaxStackCheckOffset 0xFFF
 #define MaxX2NDisplacement 992
 #define MethodCacheClass 2
-#define MethodCacheMask 0xFFC
+#define MethodCacheMask 0x7FC
 #define MethodCacheMethod 3
 #define MethodCacheSelector 1
 #define MethodIndex 3
@@ -1130,6 +1130,7 @@
 static sqInt tryCollapseTempVectorInitializationOfSize(sqInt slots) NoDbgRegParms;
 static sqInt v3or4PushNilSizenumInitialNils(sqInt aMethodObj, sqInt numInitialNils) NoDbgRegParms;
 static sqInt v3or4NumPushNils(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
+static sqInt unreachable(void);
 
 
 /*** Variables ***/
@@ -7311,10 +7312,12 @@
 	annotation = annotationForMcpcin(outerReturn, callerMethod);
 	assert(annotation >= IsSendCall);
 	if (annotation == IsNSSelfSend) {
-		return ceSelfSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		ceSelfSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		unreachable();
 	}
 	if (annotation == IsNSDynamicSuperSend) {
-		return ceDynamicSuperSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		ceDynamicSuperSendtonumArgs((targetMethod->selector), receiver, (targetMethod->cmNumArgs));
+		unreachable();
 	}
 
 	assert(((((sqInt)targetMethod)) + cmEntryOffset) == entryPoint);
@@ -28323,3 +28326,10 @@
 				? 1
 				: 0));
 }
+
+	/* VMClass>>#unreachable */
+static sqInt
+unreachable(void)
+{
+	error("UNREACHABLE");
+}

Modified: branches/Cog/nsspursrc/vm/cointerp.c
===================================================================
--- branches/Cog/nsspursrc/vm/cointerp.c	2015-06-23 17:57:36 UTC (rev 3388)
+++ branches/Cog/nsspursrc/vm/cointerp.c	2015-06-25 20:55:14 UTC (rev 3389)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1371 uuid: a51022d9-e5d7-4dbf-83d3-4326bd5ea61f
+	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.1380 uuid: 582c96d5-f95a-4916-a11d-62c452accc31
    from
-	CoInterpreter VMMaker.oscog-eem.1371 uuid: a51022d9-e5d7-4dbf-83d3-4326bd5ea61f
+	CoInterpreter VMMaker.oscog-eem.1380 uuid: 582c96d5-f95a-4916-a11d-62c452accc31
  */
-static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1371 uuid: a51022d9-e5d7-4dbf-83d3-4326bd5ea61f " __DATE__ ;
+static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.1380 uuid: 582c96d5-f95a-4916-a11d-62c452accc31 " __DATE__ ;
 char *__interpBuildInfo = __buildInfo;
 
 
@@ -127,6 +127,7 @@
 
 
 /*** Constants ***/
+#define AccessModifierPrivate 1
 #define AccessModifierPublic 0
 #define ActiveProcessIndex 1
 #define AlternateHeaderHasPrimFlag 0x20000
@@ -154,7 +155,6 @@
 #define CharacterTable null
 #define CharacterValueIndex 0
 #define CheckAllocationFillerAfterPrimCall 16
-#define CheckPrivacyViolations 0
 #define ClassAlien 52
 #define ClassArray 7
 #define ClassArrayCompactIndex 51
@@ -217,6 +217,7 @@
 #define EnclosingObjectIndex 4
 #define EncounteredUnknownBytecode -6
 #define EndOfRun 0x101
+#define EnforceAccessControl 0
 #define EphemeronQueueRootIndex 4098
 #define ExcessSignalsIndex 2
 #define ExternalObjectsArray 38
@@ -248,6 +249,11 @@
 #define LastLinkIndex 1
 #define LiteralStart 1
 #define LongStoreBytecode 129
+#define LookupRuleDynamicSuper 0x101
+#define LookupRuleImplicit 0x100
+#define LookupRuleMNU 259
+#define LookupRuleOrdinary 258
+#define LookupRuleSelf 0
 #define MarkObjectsForEnumerationPrimitives 0
 #define MarkOnTenure 5
 #define MarkStackRootIndex 0x1000
@@ -263,13 +269,13 @@
 #define MessageSelectorIndex 0
 #define MethodArrayIndex 1
 #define MethodCacheClass 2
-#define MethodCacheEntries 0x400
+#define MethodCacheEntries 0x200
 #define MethodCacheEntrySize 4
-#define MethodCacheMask 0xFFC
+#define MethodCacheMask 0x7FC
 #define MethodCacheMethod 3
 #define MethodCachePrimFunction 4
 #define MethodCacheSelector 1
-#define MethodCacheSize 4096
+#define MethodCacheSize 2048
 #define MethodDictionaryIndex 1
 #define MethodHeaderArgCountShift 25
 #define MethodHeaderFlagBitPosition 29
@@ -290,6 +296,15 @@
 #define NextLinkIndex 0
 #define NilObject 0
 #define NotFullyInitialized -1
+#define NSMethodCacheActualReceiver 7
+#define NSMethodCacheCallingMethod 3
+#define NSMethodCacheClassTag 2
+#define NSMethodCacheDepthOrLookupRule 4
+#define NSMethodCacheMask 0xFF8
+#define NSMethodCachePrimFunction 6
+#define NSMethodCacheSelector 1
+#define NSMethodCacheSize 4096
+#define NSMethodCacheTargetMethod 5
 #define ObjStackFixedSlots 4
 #define ObjStackFreex 2
 #define ObjStackLimit 0xFF8
@@ -424,15 +439,15 @@
 extern void ceCheckProfileTick(void);
 extern sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
 extern sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
-extern sqInt ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
+extern void ceDynamicSuperSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
 extern sqInt ceEnclosingObjectAt(sqInt level);
-extern sqInt ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver);
+extern void ceImplicitReceiverSendreceiver(sqInt cacheAddress, sqInt methodReceiver);
 extern sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
 extern sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
 extern sqInt ceNonLocalReturn(sqInt returnValue);
-extern sqInt ceOuterSendreceiver(sqInt cacheAddress, sqInt methodReceiver);
+extern void ceOuterSendreceiver(sqInt cacheAddress, sqInt methodReceiver);
 extern sqInt ceReturnToInterpreter(sqInt anOop);
-extern sqInt ceSelfSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
+extern void ceSelfSendtonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
 extern sqInt ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
 extern sqInt ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC);
 extern sqInt ceSendMustBeBoolean(sqInt anObject);
@@ -465,6 +480,7 @@
 static sqInt externalInstVarofContext(sqInt offset, sqInt aContext) NoDbgRegParms;
 static void findNewMethodInClassTag(sqInt classTagArg) NoDbgRegParms;
 extern sqInt flushExternalPrimitiveOf(sqInt methodObj);
+static void flushMethodCache(void);
 static void followForwardedFieldsInCurrentMethod(void);
 static void followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags) NoDbgRegParms;
 extern void forceInterruptCheckFromHeartbeat(void);
@@ -487,7 +503,6 @@
 static sqInt iframeReceiver(char *theFP) NoDbgRegParms;
 static sqInt iframeSavedIP(char *theFP) NoDbgRegParms;
 extern void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
-extern sqInt implicitReceiverFormixinimplementing(sqInt methodReceiver, sqInt methodMixin, sqInt selector);
 extern usqInt instructionPointerAddress(void);
 static sqInt instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr) NoDbgRegParms;
 extern usqInt interpretAddress(void);
@@ -495,6 +510,9 @@
 static sqInt interpretMethodFromMachineCode(void);
 extern sqInt isCogMethodReference(sqInt methodHeader);
 static sqInt isMachineCodeFrame(char *theFP) NoDbgRegParms;
+static sqInt lookupLexicalNoMNUfromrule(sqInt selector, sqInt mixin, sqInt rule) NoDbgRegParms;
+static sqInt lookupOuterSendNoMNUdepth(sqInt methodReceiver, sqInt depth) NoDbgRegParms;
+static sqInt lookupProtectedNoMNUstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule) NoDbgRegParms;
 extern sqInt lookupreceiver(sqInt selector, sqInt rcvr);
 static StackPage * makeBaseFrameFor(sqInt aContext) NoDbgRegParms;
 static void mapPrimTraceLog(void);
@@ -932,7 +950,6 @@
 extern sqInt classExternalLibrary(void);
 extern sqInt classExternalStructure(void);
 extern sqInt classFloat(void);
-static sqInt classForClassTag(sqInt classIndex) NoDbgRegParms;
 static sqInt classIndexFieldWidth(void);
 extern sqInt classIndexMask(void);
 extern sqInt classIndexOf(sqInt objOop);
@@ -1230,9 +1247,11 @@
 static usqInt totalBytesInSegments(void);
 static sqInt writeImageSegmentsToFile(sqImageFile aBinaryStream) NoDbgRegParms;
 static sqInt writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSegment, sqImageFile aBinaryStream) NoDbgRegParms;
+static sqInt accessModifierOfMethodHeader(sqInt header) NoDbgRegParms;
 static sqInt accessModifierOfMethod(sqInt methodObj) NoDbgRegParms;
 extern sqInt activeProcess(void);
 static void addLastLinktoList(sqInt proc, sqInt aList) NoDbgRegParms;
+static void addNewMethodToNSCache(sqInt rule) NoDbgRegParms;
 static sqInt addressCouldBeClassObj(sqInt maybeClassObj) NoDbgRegParms;
 static char * allocateMemoryminimumimageFileheaderSize(sqInt heapSize, sqInt minimumMemory, sqImageFile fileStream, sqInt headerSize) NoDbgRegParms;
 extern sqInt argumentCountOfClosure(sqInt closurePointer);
@@ -1288,6 +1307,7 @@
 extern 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 findClassContainingMethodstartingAt(sqInt meth, sqInt classObj) NoDbgRegParms;
 extern sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr);
 static char * findFrameAboveinPage(char *theFP, StackPage *thePage) NoDbgRegParms;
@@ -1329,6 +1349,7 @@
 static usqInt iframeMethod(char *theFP) NoDbgRegParms;
 static sqInt imageFormatVersion(void);
 extern sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
+static sqInt inlineLookupInNSMethodCacheSelclassTagmethodlookupRule(sqInt selector, sqInt classTag, sqInt callingMethod, sqInt lookupRule) NoDbgRegParms;
 extern sqInt integerArg(sqInt index);
 extern void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
 static sqInt isBaseFrame(char *theFP) NoDbgRegParms;
@@ -1355,8 +1376,10 @@
 extern void longPrintOop(sqInt oop);
 extern sqInt longStoreBytecodeForHeader(sqInt methodHeader);
 static sqInt lookupInMethodCacheSelclassTag(sqInt selector, sqInt classTag) NoDbgRegParms;
+static sqInt lookupLexicalfromrule(sqInt selector, sqInt mixin, sqInt rule) NoDbgRegParms;
 static sqInt lookupMethodInClass(sqInt class) NoDbgRegParms;
 static sqInt lookupMethodNoMNUEtcInClass(sqInt class) NoDbgRegParms;
+static sqInt lookupProtectedstartingAtrule(sqInt selector, sqInt mixinApplication, sqInt rule) NoDbgRegParms;
 extern sqInt lookupSelectorinClass(sqInt selector, sqInt class);
 extern sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue);
 static void mapInterpreterOops(void);
@@ -1557,9 +1580,9 @@
 _iss sqInt argumentCount;
 _iss sqInt bytecodeSetSelector;
 _iss usqInt instructionPointer;
+_iss sqInt messageSelector;
 _iss usqInt newMethod;
 _iss sqInt markStack;
-_iss sqInt messageSelector;
 _iss StackPage * pages;
 _iss usqInt newSpaceLimit;
 _iss char * stackBasePlus1;
@@ -1567,19 +1590,21 @@
 _iss usqInt endOfMemory;
 _iss sqInt weaklingStack;
 _iss usqInt newSpaceStart;
+_iss sqInt lkupClassTag;
 _iss sqInt trueObj;
 _iss SpurSegmentInfo * segments;
+_iss sqInt falseObj;
 _iss sqInt hiddenRootsObj;
-_iss sqInt falseObj;
 _iss usqInt scavengeThreshold;
-_iss sqInt traceLogIndex;
 _iss usqInt totalFreeOldSpace;
 _iss sqInt bytesPerPage;
 _iss usqInt pastSpaceStart;
 _iss sqInt numSegments;
+_iss sqInt localAbsentReceiver;
+_iss sqInt traceLogIndex;
+_iss sqInt classTableFirstPage;
 _iss char * stackLimit;
 _iss unsigned char primTraceLogIndex;
-_iss sqInt classTableFirstPage;
 _iss sqInt * freeLists;
 _iss sqInt rememberedSetSize;
 _iss sqInt tempOop;
@@ -1587,12 +1612,13 @@
 _iss sqInt remapBufferCount;
 _iss usqInt freeListsMask;
 _iss usqInt firstFreeChunk;
+_iss sqInt lkupClass;
+_iss sqInt localAbsentReceiverOrZero;
 _iss sqInt longRunningPrimitiveCheckSemaphore;
 _iss SpurContiguousObjStack unscannedEphemerons;
 _iss sqInt numStackPages;
 _iss StackPage * mostRecentlyUsedPage;
 _iss SpurNewSpaceSpace pastSpace;
-_iss sqInt lkupClass;
 _iss sqInt longRunningPrimitiveCheckMethod;
 _iss usqInt oldSpaceStart;
 _iss sqLong nextProfileTick;
@@ -1620,8 +1646,8 @@
 _iss sqInt classNameIndex;
 _iss sqInt ephemeronQueue;
 _iss sqInt tenureCriterion;
-_iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt metaclassNumSlots;
+_iss sqInt methodDictLinearSearchLimit;
 _iss sqInt preemptionYields;
 _iss sqInt cogCompiledCodeCompactionCalledFor;
 _iss sqInt gcMode;
@@ -1649,6 +1675,7 @@
 _iss sqInt shrinkThreshold;
 _iss usqLong statIOProcessEvents;
 _iss sqInt lastHash;
+_iss sqInt lastMethodCacheProbeWrite;
 _iss sqInt longRunningPrimitiveCheckSequenceNumber;
 _iss sqInt marking;
 _iss usqInt memory;
@@ -1659,7 +1686,6 @@
 _iss usqInt heapSizeAtPreviousGC;
 _iss sqInt interruptKeycode;
 _iss sqInt interruptPending;
-_iss sqInt methodDictLinearSearchLimit;
 _iss usqLong nextPollUsecs;
 _iss sqInt rememberedSetRedZone;
 _iss sqInt statCompactPassCount;
@@ -1707,7 +1733,8 @@
 _iss sqInt statSurvivorCount;
 _iss sqInt tenuringClassIndex;
 _iss sqInt the2ndUnknownShort;
-_iss long methodCache[MethodCacheSize + 1 /* 4097 */];
+_iss long methodCache[MethodCacheSize + 1 /* 2049 */];
+_iss long nsMethodCache[NSMethodCacheSize + 1 /* 4097 */];
 _iss sqInt atCache[AtCacheTotalSize + 1 /* 65 */];
 _iss sqInt traceLog[TraceBufferSize /* 768 */];
 _iss sqInt primTraceLog[256];
@@ -2376,7 +2403,7 @@
 /*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
 	};
 char expensiveAsserts = 0;
-const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1371";
+const char *interpreterVersion = "Newspeak Virtual Machine CoInterpreterPrimitives_VMMaker.oscog-eem.1380";
 sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
 volatile int sendTrace;
 
@@ -2464,8 +2491,6 @@
     sqInt currentBytecode;
     sqInt extA;
     sqInt extB;
-    sqInt lkupClassTag;
-    sqInt localAbsentReceiver;
     char * localFP;
     char * localIP;
     sqInt localReturnValue;
@@ -5140,7 +5165,7 @@
 				frameToReturnTo = 0;
 				if (!((byteAt((localFP + FoxIFrameFlags) + 3)) != 0)) {
 					goto commonCallerReturn;
-					goto l241;
+					goto l228;
 				}
 				closure = longAt(localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
 	? ((mframeCogMethod(localFP))->cmNumArgs)
@@ -5193,10 +5218,10 @@
 						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 						assert(isContext(frameContext(localFP)));
 						ourContext = longAt(localFP + FoxThisContext);
-						goto l245;
+						goto l232;
 					}
 					ourContext = marryFrameSP(localFP, localSP);
-				l245:	/* end ensureFrameIsMarried:SP: */;
+				l232:	/* end ensureFrameIsMarried:SP: */;
 					/* begin internalPush: */
 					longAtPointerput((localSP -= BytesPerOop), ourContext);
 					/* begin internalPush: */
@@ -5205,7 +5230,7 @@
 					GIV(argumentCount) = 1;
 					goto normalSend;
 					/* return self */
-					goto l241;
+					goto l228;
 				}
 				if (unwindContextOrNilOrZero != 0) {
 					/* begin internalAboutToReturn:through: */
@@ -5215,10 +5240,10 @@
 						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 						assert(isContext(frameContext(localFP)));
 						ourContext1 = longAt(localFP + FoxThisContext);
-						goto l242;
+						goto l229;
 					}
 					ourContext1 = marryFrameSP(localFP, localSP);
-				l242:	/* end ensureFrameIsMarried:SP: */;
+				l229:	/* end ensureFrameIsMarried:SP: */;
 					/* begin internalPush: */
 					longAtPointerput((localSP -= BytesPerOop), ourContext1);
 					/* begin internalPush: */
@@ -5229,7 +5254,7 @@
 					GIV(argumentCount) = 2;
 					goto normalSend;
 					/* return self */
-					goto l241;
+					goto l228;
 				}
 				contextToReturnTo = null;
 				if (((longAt((home + BaseHeaderSize) + (SenderIndex << (shiftForWord())))) & 1)) {
@@ -5286,10 +5311,10 @@
 							: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 							assert(isContext(frameContext(localFP)));
 							ourContext2 = longAt(localFP + FoxThisContext);
-							goto l244;
+							goto l231;
 						}
 						ourContext2 = marryFrameSP(localFP, localSP);
-					l244:	/* end ensureFrameIsMarried:SP: */;
+					l231:	/* end ensureFrameIsMarried:SP: */;
 						/* begin internalPush: */
 						longAtPointerput((localSP -= BytesPerOop), ourContext2);
 						/* begin internalPush: */
@@ -5298,7 +5323,7 @@
 						GIV(argumentCount) = 1;
 						goto normalSend;
 						/* return self */
-						goto l241;
+						goto l228;
 					}
 				}
 				assert(pageListIsWellFormed());
@@ -5417,11 +5442,11 @@
 						GIV(framePointer) = localFP;
 						
 						ceEnterCogCodePopReceiverReg();
-						goto l243;
+						goto l230;
 					}
 					localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
 				}
-			l243:	/* end maybeReturnToMachineCodeFrame */;
+			l230:	/* end maybeReturnToMachineCodeFrame */;
 				/* begin setMethod: */
 				aMethodObj = longAt(localFP + FoxMethod);
 				assert((((usqInt)aMethodObj)) >= (startOfMemory()));
@@ -5436,7 +5461,7 @@
 
 				longAtPointerput(localSP, localReturnValue);
 			}
-		l241:	/* end case */;
+		l228:	/* end case */;
 			break;
 		case 121:
 			/* returnTrue */
@@ -5557,27 +5582,27 @@
 							fp = (thePage->headFP);
 							if (fp == theFP) {
 								frameAbove = 0;
-								goto l248;
+								goto l235;
 							}
 							while (((callerFP = frameCallerFP(fp))) != 0) {
 								if (callerFP == theFP) {
 									frameAbove = fp;
-									goto l248;
+									goto l235;
 								}
 								fp = callerFP;
 							}
 							error("did not find theFP in stack page");
 							frameAbove = 0;
-						l248:	/* end findFrameAbove:inPage: */;
+						l235:	/* end findFrameAbove:inPage: */;
 							/* begin newStackPage */
 							lruOrFree = ((mostRecentlyUsedPage())->nextPage);
 							if (isFree(lruOrFree)) {
 								newPage = lruOrFree;
-								goto l249;
+								goto l236;
 							}
 							divorceFramesIn(lruOrFree);
 							newPage = lruOrFree;
-						l249:	/* end newStackPage */;
+						l236:	/* end newStackPage */;
 							assert(newPage == GIV(stackPage));
 							moveFramesInthroughtoPage(thePage, frameAbove, newPage);
 							markStackPageMostRecentlyUsed(newPage);
@@ -5601,7 +5626,7 @@
 							longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
 							GIV(stackPointer) = sp2;
 							ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SelectorCannotReturn << (shiftForWord()))), contextToReturnFrom, 1);
-							goto l247;
+							goto l234;
 						}
 						GIV(instructionPointer) = 0;
 						thePage = makeBaseFrameFor(contextToReturnTo);
@@ -5639,7 +5664,7 @@
 							GIV(framePointer) = localFP;
 							
 							ceEnterCogCodePopReceiverReg();
-							goto l247;
+							goto l234;
 						}
 						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
 					}
@@ -5658,8 +5683,8 @@
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
 					/* return self */
-				l247:	/* end baseFrameReturn */;
-					goto l246;
+				l234:	/* end baseFrameReturn */;
+					goto l233;
 				}
 				/* begin frameCallerSavedIP: */
 				localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP));
@@ -5687,7 +5712,7 @@
 						GIV(framePointer) = localFP;
 						
 						ceEnterCogCodePopReceiverReg();
-						goto l246;
+						goto l233;
 					}
 					localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
 				}
@@ -5705,7 +5730,7 @@
 
 				longAtPointerput(localSP, localReturnValue);
 			}
-		l246:	/* end case */;
+		l233:	/* end case */;
 			break;
 		case 126:
 		case 127:
@@ -5734,10 +5759,10 @@
 					: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
 					assert(isContext(frameContext(localFP)));
 					ourContext = longAt(localFP + FoxThisContext);
-					goto l250;
+					goto l237;
 				}
 				ourContext = marryFrameSP(localFP, localSP);
-			l250:	/* end ensureFrameIsMarried:SP: */;
+			l237:	/* end ensureFrameIsMarried:SP: */;
 				localIP -= 1;
 				/* begin internalPush: */
 				longAtPointerput((localSP -= BytesPerOop), ourContext);
@@ -6008,15 +6033,15 @@
 
 				VM_LABEL(normalSend);
 				rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
-				lkupClassTag = (((tagBits = rcvr & 3)) != 0
+				GIV(lkupClassTag) = (((tagBits = rcvr & 3)) != 0
 					? ((tagBits & 1) != 0
 							? 1
 							: tagBits)
 					: (longAt(rcvr)) & 0x3FFFFF);
-				assert(lkupClassTag != (nilObject()));
+				assert(GIV(lkupClassTag) != (nilObject()));
 				
-			commonSend:
-				/* commonSend */
+			commonSendOrdinary:
+				/* commonSendOrdinary */
 				{
 					sqInt classOrInteger;
 					sqInt classTablePage;
@@ -6042,7 +6067,7 @@
 					sqInt switched;
 					sqInt table;
 
-					VM_LABEL(commonSend);
+					VM_LABEL(commonSendOrdinary);
 					nArgs = 0;
 					savedFramePointer = 0;
 					savedStackPointer = 0;
@@ -6051,63 +6076,63 @@
 					if (recordSendTrace()) {
 						/* begin recordTrace:thing:source: */
 						/* begin classAtIndex: */
-						assert((lkupClassTag <= (tagMask()))
-						 || (lkupClassTag >= (arrayClassIndexPun())));
-						classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) lkupClassTag) >> 10) << (shiftForWord())));
+						assert((GIV(lkupClassTag) <= (tagMask()))
+						 || (GIV(lkupClassTag) >= (arrayClassIndexPun())));
+						classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) GIV(lkupClassTag)) >> 10) << (shiftForWord())));
 						if (classTablePage == GIV(nilObj)) {
 							classOrInteger = null;
-							goto l257;
+							goto l244;
 						}
-						classOrInteger = longAt((classTablePage + BaseHeaderSize) + ((lkupClassTag & ((1 << 10) - 1)) << (shiftForWord())));
-					l257:	/* end classAtIndex: */;
+						classOrInteger = longAt((classTablePage + BaseHeaderSize) + ((GIV(lkupClassTag) & ((1 << 10) - 1)) << (shiftForWord())));
+					l244:	/* end classAtIndex: */;
 						GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger;
 						GIV(traceLog)[GIV(traceLogIndex) + 1] = GIV(messageSelector);
 						GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter;
 						GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
 						if (printOnTrace()) {
-							printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(lkupClassTag));
+							printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag)));
 							/* begin cr */
 							printf("\n");
 						}
 					}
-					/* begin internalFindNewMethod: */
+					/* begin internalFindNewMethodOrdinary */
 					/* begin inlineLookupInMethodCacheSel:classTag: */
 
 					/* shift drops two low-order zeros from addresses */
 
-					hash = GIV(messageSelector) ^ lkupClassTag;
+					hash = GIV(messageSelector) ^ GIV(lkupClassTag);
 
 					/* first probe */
 
 					probe = hash & MethodCacheMask;
 					if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector))
-					 && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) {
+					 && ((GIV(methodCache)[probe + MethodCacheClass]) == GIV(lkupClassTag))) {
 						GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
 						primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
 						ok = 1;
-						goto l252;
+						goto l239;
 					}
 
 					/* second probe */
 
 					probe = (((usqInt) hash) >> 1) & MethodCacheMask;
 					if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector))
-					 && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) {
+					 && ((GIV(methodCache)[probe + MethodCacheClass]) == GIV(lkupClassTag))) {
 						GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
 						primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
 						ok = 1;
-						goto l252;
+						goto l239;
 					}
 					probe = (((usqInt) hash) >> 2) & MethodCacheMask;
 					if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector))
-					 && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) {
+					 && ((GIV(methodCache)[probe + MethodCacheClass]) == GIV(lkupClassTag))) {
 						GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
 						primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
 						ok = 1;
-						goto l252;
+						goto l239;
 					}
 					ok = 0;
-				l252:	/* end inlineLookupInMethodCacheSel:classTag: */;
+				l239:	/* end inlineLookupInMethodCacheSel:classTag: */;
 					if (ok) {
 						/* begin ifAppropriateCompileToNativeCode:selector: */
 						methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << (shiftForWord())));
@@ -6137,15 +6162,15 @@
 						GIV(framePointer) = localFP;
 						if ((((GIV(messageSelector) & 3) == 0)
 						 && (((longAt(GIV(messageSelector))) & 0x3FFFFF) == 8))
-						 || (lkupClassTag == 8)) {
+						 || (GIV(lkupClassTag) == 8)) {
 							if (((GIV(messageSelector) & 3) == 0)
 							 && (((longAt(GIV(messageSelector))) & 0x3FFFFF) == 8)) {
 								GIV(messageSelector) = handleForwardedSelectorFaultFor(GIV(messageSelector));
 							}
-							if (lkupClassTag == 8) {
-								lkupClassTag = handleForwardedSendFaultForTag(lkupClassTag);
+							if (GIV(lkupClassTag) == 8) {
+								GIV(lkupClassTag) = handleForwardedSendFaultForTag(GIV(lkupClassTag));
 							}
-							if (lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag)) {
+							if (lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag))) {
 								/* begin ifAppropriateCompileToNativeCode:selector: */
 								methodHeader1 = longAt((GIV(newMethod) + BaseHeaderSize) + (HeaderIndex << (shiftForWord())));
 								if (isCogMethodReference(methodHeader1)) {
@@ -6165,19 +6190,19 @@
 										maybeFlagMethodAsInterpreted(GIV(newMethod));
 									}
 								}
-								goto l255;
+								goto l242;
 							}
 						}
 						/* begin classAtIndex: */
-						assert((lkupClassTag <= (tagMask()))
-						 || (lkupClassTag >= (arrayClassIndexPun())));
-						classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) lkupClassTag) >> 10) << (shiftForWord())));
+						assert((GIV(lkupClassTag) <= (tagMask()))
+						 || (GIV(lkupClassTag) >= (arrayClassIndexPun())));
+						classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) GIV(lkupClassTag)) >> 10) << (shiftForWord())));
 						if (classTablePage1 == GIV(nilObj)) {
 							GIV(lkupClass) = null;
-							goto l251;
+							goto l238;
 						}
-						GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + ((lkupClassTag & ((1 << 10) - 1)) << (shiftForWord())));
-					l251:	/* end classAtIndex: */;
+						GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + ((GIV(lkupClassTag) & ((1 << 10) - 1)) << (shiftForWord())));
+					l238:	/* end classAtIndex: */;
 						lookupMethodInClass(GIV(lkupClass));
 						/* begin internalizeIPandSP */
 						assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
@@ -6186,7 +6211,7 @@
 						localFP = pointerForOop(GIV(framePointer));
 						addNewMethodToCache(GIV(lkupClass));
 					}
-				l255:	/* end internalFindNewMethod: */;
+				l242:	/* end internalFindNewMethodOrdinary */;
 					/* begin internalExecuteNewMethod */
 					if (primitiveFunctionPointer != 0) {
 						if ((((unsigned long) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) {
@@ -6199,31 +6224,31 @@
 								/* begin internalStackTopPut: */
 								longAtPointerput(localSP, longAt(((longAtPointer(localSP)) + BaseHeaderSize) + ((localPrimIndex - 264) << (shiftForWord()))));
 								1;
-								goto l253;
+								goto l240;
 							}
 							if (localPrimIndex == 256) {
 								1;
-								goto l253;
+								goto l240;
 							}
 							if (localPrimIndex == 257) {
 								longAtPointerput(localSP, GIV(trueObj));
 								1;
-								goto l253;
+								goto l240;
 							}
 							if (localPrimIndex == 258) {
 								longAtPointerput(localSP, GIV(falseObj));
 								1;
-								goto l253;
+								goto l240;
 							}
 							if (localPrimIndex == 259) {
 								longAtPointerput(localSP, GIV(nilObj));
 								1;
-								goto l253;
+								goto l240;
 							}
 							longAtPointerput(localSP, (((localPrimIndex - 261) << 1) | 1));
 							1;
-						l253:	/* end internalQuickPrimitiveResponse */;
-							goto l254;
+						l240:	/* end internalQuickPrimitiveResponse */;
+							goto l241;
 						}
 						/* begin externalizeIPandSP */
 						assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
@@ -6287,7 +6312,7 @@
 							returntoExecutive(popStack(), 1);
 							browserPluginReturnIfNeeded();
 							null;
-							goto l254;
+							goto l241;
 						}
 					}
 					if (methodHasCogMethod(GIV(newMethod))) {
@@ -6364,11 +6389,11 @@
 										table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (PrimErrTableIndex << (shiftForWord())));
 										if (GIV(primFailCode) <= (numSlotsOf(table))) {
 											errorCode = longAt((table + BaseHeaderSize) + ((GIV(primFailCode) - 1) << (shiftForWord())));
-											goto l256;
+											goto l243;
 										}
 									}
 									errorCode = ((GIV(primFailCode) << 1) | 1);
-								l256:	/* end getErrorObjectFromPrimFailCode */;
+								l243:	/* end getErrorObjectFromPrimFailCode */;
 									longAtPointerput(localSP, errorCode);
 								}
 								GIV(primFailCode) = 0;
@@ -6392,7 +6417,7 @@
 							localFP = pointerForOop(GIV(framePointer));
 						}
 					}
-				l254:	/* end internalExecuteNewMethod */;
+				l241:	/* end internalExecuteNewMethod */;
 					/* begin fetchNextBytecode */
 					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
@@ -6816,7 +6841,7 @@
 				assert(addressCouldBeClassObj(superclass));
 				/* begin ensureBehaviorHash: */
 				assert(addressCouldBeClassObj(superclass));
-				lkupClassTag = (((hash1 = (long32At(superclass + 4)) & 0x3FFFFF)) != 0
+				GIV(lkupClassTag) = (((hash1 = (long32At(superclass + 4)) & 0x3FFFFF)) != 0
 					? hash1
 					: (objCouldBeClassObj(superclass)
 							? (((err1 = enterIntoClassTable(superclass))) != 0
@@ -6838,8 +6863,8 @@
 					aValue = referent;
 					longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue);
 				}
-				assert(lkupClassTag != (nilObject()));
-				goto commonSend;
+				assert(GIV(lkupClassTag) != (nilObject()));
+				goto commonSendOrdinary;
 			}
 			break;
 		case 134:
@@ -7841,7 +7866,7 @@
 						/* begin fetchNextBytecode */
 						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-						goto l258;
+						goto l245;
 					}
 					if (bytecode == 172) {
 
@@ -7851,7 +7876,7 @@
 						/* begin fetchNextBytecode */
 						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-						goto l258;
+						goto l245;
 					}
 					if (bytecode > 167) {
 
@@ -7862,7 +7887,7 @@
 						localIP = (localIP + offset) + 1;
 						currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
 
-						goto l258;
+						goto l245;
 					}
 				}
 				currentBytecode = bytecode + GIV(bytecodeSetSelector);
@@ -7870,7 +7895,7 @@
 				/* begin internalPush: */
 				longAtPointerput((localSP -= BytesPerOop), GIV(trueObj));
 			}
-		l258:	/* end case */;
+		l245:	/* end case */;
 			break;
 		case 179:
 			/* bytecodePrimGreaterThan */
@@ -7987,7 +8012,7 @@
 					localIP = (localIP + (bytecode - 151)) + 1;
 					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
 
-					goto l259;
+					goto l246;
 				}
 				if (bytecode == 172) {
 
@@ -7998,14 +8023,14 @@
 					localIP = (localIP + offset) + 1;
 					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
 
-					goto l259;
+					goto l246;
 				}
 				currentBytecode = bytecode + GIV(bytecodeSetSelector);
 
 				/* begin internalPush: */
 				longAtPointerput((localSP -= BytesPerOop), GIV(falseObj));
 			}
-		l259:	/* end case */;
+		l246:	/* end case */;
 			break;
 		case 180:
 			/* bytecodePrimLessOrEqual */
@@ -8960,12 +8985,12 @@
 
 					atIx = rcvr & AtCacheMask;
 					if ((GIV(atCache)[atIx + AtCacheOop]) != rcvr) {
-						lkupClassTag = (longAt(rcvr)) & 0x3FFFFF;
+						GIV(lkupClassTag) = (longAt(rcvr)) & 0x3FFFFF;
 						/* begin fetchPointer:ofObject: */
 						GIV(messageSelector) = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SpecialSelectors << (shiftForWord())))) + BaseHeaderSize) + ((16 * 2) << (shiftForWord())));
-						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag))) {
+						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) {
 							GIV(argumentCount) = 1;
-							goto commonSend;
+							goto commonSendOrdinary;
 							goto l78;
 						}
 						if (primitiveFunctionPointer == primitiveAt) {
@@ -9087,7 +9112,7 @@
 							}
 							else {
 								GIV(argumentCount) = 1;
-								goto commonSend;
+								goto commonSendOrdinary;
 								goto l78;
 							}
 						}
@@ -9261,12 +9286,12 @@
 
 					atIx = (rcvr & AtCacheMask) + AtPutBase;
 					if ((GIV(atCache)[atIx + AtCacheOop]) != rcvr) {
-						lkupClassTag = (longAt(rcvr)) & 0x3FFFFF;
+						GIV(lkupClassTag) = (longAt(rcvr)) & 0x3FFFFF;
 						/* begin fetchPointer:ofObject: */
 						GIV(messageSelector) = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SpecialSelectors << (shiftForWord())))) + BaseHeaderSize) + ((17 * 2) << (shiftForWord())));
-						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag))) {
+						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) {
 							GIV(argumentCount) = 2;
-							goto commonSend;
+							goto commonSendOrdinary;
 							goto l89;
 						}
 						if (primitiveFunctionPointer == primitiveAtPut) {
@@ -9388,7 +9413,7 @@
 							}
 							else {
 								GIV(argumentCount) = 2;
-								goto commonSend;
+								goto commonSendOrdinary;
 								goto l89;
 							}
 						}
@@ -9977,13 +10002,13 @@
 				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((currentBytecode & 15) + LiteralStart) << (shiftForWord())));
 				GIV(argumentCount) = 0;
 				rcvr = longAtPointer(localSP + (0 * BytesPerOop));
-				lkupClassTag = (((tagBits = rcvr & 3)) != 0
+				GIV(lkupClassTag) = (((tagBits = rcvr & 3)) != 0
 					? ((tagBits & 1) != 0
 							? 1
 							: tagBits)
 					: (longAt(rcvr)) & 0x3FFFFF);
-				assert(lkupClassTag != (nilObject()));
-				goto commonSend;
+				assert(GIV(lkupClassTag) != (nilObject()));
+				goto commonSendOrdinary;
 			}
 			break;
 		case 224:
@@ -10029,13 +10054,13 @@
 				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((currentBytecode & 15) + LiteralStart) << (shiftForWord())));
 				GIV(argumentCount) = 1;
 				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
-				lkupClassTag = (((tagBits = rcvr & 3)) != 0
+				GIV(lkupClassTag) = (((tagBits = rcvr & 3)) != 0
 					? ((tagBits & 1) != 0
 							? 1
 							: tagBits)
 					: (longAt(rcvr)) & 0x3FFFFF);
-				assert(lkupClassTag != (nilObject()));
-				goto commonSend;
+				assert(GIV(lkupClassTag) != (nilObject()));
+				goto commonSendOrdinary;
 			}
 			break;
 		case 240:
@@ -10081,13 +10106,13 @@
 				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((currentBytecode & 15) + LiteralStart) << (shiftForWord())));
 				GIV(argumentCount) = 2;
 				rcvr = longAtPointer(localSP + (2 * BytesPerOop));
-				lkupClassTag = (((tagBits = rcvr & 3)) != 0
+				GIV(lkupClassTag) = (((tagBits = rcvr & 3)) != 0
 					? ((tagBits & 1) != 0
 							? 1
 							: tagBits)
 					: (longAt(rcvr)) & 0x3FFFFF);
-				assert(lkupClassTag != (nilObject()));
-				goto commonSend;
+				assert(GIV(lkupClassTag) != (nilObject()));
+				goto commonSendOrdinary;
 			}
 			break;
 		case 333: /*77*/
@@ -10463,7 +10488,7 @@
 						/* begin fetchNextBytecode */
 						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-						goto l260;
+						goto l247;
 					}
 					if (bytecode == 244) {
 
@@ -10473,7 +10498,7 @@
 						/* begin fetchNextBytecode */
 						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
 
-						goto l260;
+						goto l247;
 					}
 					if (bytecode == 243) {
 
@@ -10484,7 +10509,7 @@
 						localIP = (localIP + offset) + 1;
 						currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
 
-						goto l260;
+						goto l247;
 					}
 				}
 				currentBytecode = bytecode + GIV(bytecodeSetSelector);
@@ -10492,7 +10517,7 @@
 				/* begin internalPush: */
 				longAtPointerput((localSP -= BytesPerOop), GIV(trueObj));
 			}
-		l260:	/* end case */;
+		l247:	/* end case */;
 			break;
 		case 339: /*83*/
 			/* bytecodePrimGreaterThanV4 */
@@ -10609,7 +10634,7 @@
 					localIP = (localIP + (bytecode - 207)) + 1;
 					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
 
-					goto l261;
+					goto l248;
 				}
 				if (bytecode == 244) {
 
@@ -10620,14 +10645,14 @@
 					localIP = (localIP + offset) + 1;
 					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
 
-					goto l261;
+					goto l248;
 				}
 				currentBytecode = bytecode + GIV(bytecodeSetSelector);
 
 				/* begin internalPush: */
 				longAtPointerput((localSP -= BytesPerOop), GIV(falseObj));
 			}
-		l261:	/* end case */;
+		l248:	/* end case */;
 			break;
 		case 340: /*84*/
 			/* bytecodePrimLessOrEqualV4 */
@@ -11582,12 +11607,12 @@
 
 					atIx = rcvr & AtCacheMask;
 					if ((GIV(atCache)[atIx + AtCacheOop]) != rcvr) {
-						lkupClassTag = (longAt(rcvr)) & 0x3FFFFF;
+						GIV(lkupClassTag) = (longAt(rcvr)) & 0x3FFFFF;
 						/* begin fetchPointer:ofObject: */
 						GIV(messageSelector) = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SpecialSelectors << (shiftForWord())))) + BaseHeaderSize) + ((16 * 2) << (shiftForWord())));
-						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag))) {
+						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) {
 							GIV(argumentCount) = 1;
-							goto commonSend;
+							goto commonSendOrdinary;
 							goto l172;
 						}
 						if (primitiveFunctionPointer == primitiveAt) {
@@ -11709,7 +11734,7 @@
 							}
 							else {
 								GIV(argumentCount) = 1;
-								goto commonSend;
+								goto commonSendOrdinary;
 								goto l172;
 							}
 						}
@@ -11883,12 +11908,12 @@
 
 					atIx = (rcvr & AtCacheMask) + AtPutBase;
 					if ((GIV(atCache)[atIx + AtCacheOop]) != rcvr) {
-						lkupClassTag = (longAt(rcvr)) & 0x3FFFFF;
+						GIV(lkupClassTag) = (longAt(rcvr)) & 0x3FFFFF;
 						/* begin fetchPointer:ofObject: */
 						GIV(messageSelector) = longAt(((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (SpecialSelectors << (shiftForWord())))) + BaseHeaderSize) + ((17 * 2) << (shiftForWord())));
-						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag))) {
+						if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), GIV(lkupClassTag)))) {
 							GIV(argumentCount) = 2;
-							goto commonSend;
+							goto commonSendOrdinary;
 							goto l183;
 						}
 						if (primitiveFunctionPointer == primitiveAtPut) {
@@ -12010,7 +12035,7 @@
 							}
 							else {
 								GIV(argumentCount) = 2;
-								goto commonSend;
+								goto commonSendOrdinary;
 								goto l183;
 							}
 						}
@@ -12478,7 +12503,7 @@
 				assert(GIV(method) == (iframeMethod(localFP)));
 				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((currentBytecode & 15) + LiteralStart) << (shiftForWord())));
 				GIV(argumentCount) = 0;
-				goto commonSendAbsentImplicit;
+				goto commonSendImplicitReceiver;
 			}
 			break;
 		case 456: /*200*/
@@ -13356,12 +13381,12 @@
 				GIV(argumentCount) = (byte & 7) + (extB << 3);
 				extB = 0;
 				rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
-				lkupClassTag = (((tagBits = rcvr & 3)) != 0
+				GIV(lkupClassTag) = (((tagBits = rcvr & 3)) != 0
 					? ((tagBits & 1) != 0
 							? 1
 							: tagBits)
 					: (longAt(rcvr)) & 0x3FFFFF);
-				goto commonSend;
+				goto commonSendOrdinary;
 			}
 			break;
 		case 495: /*239*/
@@ -13395,31 +13420,43 @@
 				extA = 0;
 				GIV(argumentCount) = (byte & 7) + (extB << 3);
 				extB = 0;
-				/* goto commonSendAbsentImplicit */
+				/* goto commonSendImplicitReceiver */
 			}
 			
-		commonSendAbsentImplicit:
-			/* commonSendAbsentImplicit */
+		commonSendImplicitReceiver:
+			/* commonSendImplicitReceiver */
 			{
-				sqInt classOrInteger;
+				sqInt actualLookupRule;
+				sqInt candidateMixin;
+				sqInt candidateMixinApplication;
+				sqInt candidateReceiver;
 				sqInt classTablePage;
-				sqInt classTablePage1;
-				CogMethod *cogMethod;
-				CogMethod *cogMethod1;
+				sqInt dictionary;
 				sqInt errorCode;
+				sqInt found;
 				sqInt hash;
 				sqInt i;
 				sqInt i1;
+				sqInt index;
+				usqInt length;
 				sqInt localPrimIndex;
+				usqInt mask;
+				sqInt methodArray;
 				sqInt methodHeader;
-				sqInt methodHeader1;
-				sqInt methodHeader2;
+				sqInt methodReceiver;
 				sqInt nArgs;
+				sqInt nextSelector;
+				usqInt numSlots;
 				sqInt numTemps;
 				sqInt object;
-				sqInt ok;
+				sqInt objOop;
+				sqInt objOop1;
+				sqInt objOop11;
+				sqInt objOop2;
+				sqInt objOop3;
+				sqInt objOop4;
+				sqInt objOop5;
 				sqInt oop;
-				sqInt probe;
 				sqInt rcvr;
 				char *savedFramePointer;
 				char *savedStackPointer;
@@ -13427,115 +13464,38 @@
 				sqInt switched;
 				sqInt table;
 				sqInt tagBits;
+				sqInt tagBits1;
+				sqInt tagBits2;
+				sqInt wrapAround;
 
-				VM_LABEL(commonSendAbsentImplicit);
+				VM_LABEL(commonSendImplicitReceiver);
 				nArgs = 0;
 				savedFramePointer = 0;
 				savedStackPointer = 0;
-				localAbsentReceiver = implicitReceiverFormixinimplementing(longAt(localFP + FoxIFReceiver), methodClassOf(GIV(method)), GIV(messageSelector));
-				/* begin commonSendAbsent: */
-				/* 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);
+				/* begin sendBreakpoint:receiver: */
+				sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)));
+				if (printOnTrace()) {
+					printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(GIV(lkupClassTag)));
+					/* begin cr */
+					printf("\n");
 				}
-				longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), localAbsentReceiver);
-				lkupClassTag = (((tagBits = localAbsentReceiver & 3)) != 0
+				/* begin internalFindNewMethodImplicitReceiver */
+				GIV(localAbsentReceiver) = longAt(localFP + FoxIFReceiver);
+				assert(!((isOopForwarded(GIV(localAbsentReceiver)))));
+				GIV(lkupClassTag) = (((tagBits = GIV(localAbsentReceiver) & 3)) != 0
 					? ((tagBits & 1) != 0
 							? 1
 							: tagBits)
-					: (longAt(localAbsentReceiver)) & 0x3FFFFF);
-				assert((classForClassTag(lkupClassTag)) != (nilObject()));
-				
-				/* begin commonSend: */
-				/* begin sendBreakpoint:receiver: */
-				sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)));
-				if (recordSendTrace()) {
-					/* begin recordTrace:thing:source: */
-					/* begin classAtIndex: */
-					assert((lkupClassTag <= (tagMask()))
-					 || (lkupClassTag >= (arrayClassIndexPun())));
-					classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + ((((usqInt) lkupClassTag) >> 10) << (shiftForWord())));
-					if (classTablePage == GIV(nilObj)) {
-						classOrInteger = null;
-						goto l268;
+					: (longAt(GIV(localAbsentReceiver))) & 0x3FFFFF);

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list