[Vm-dev] [commit][3547] CogVM source as per VMMaker.oscog-eem.1623

commits at squeakvm.org commits at squeakvm.org
Sat Jan 9 16:25:08 UTC 2016


Revision: 3547
Author:   eliot
Date:     2016-01-09 08:25:07 -0800 (Sat, 09 Jan 2016)
Log Message:
-----------
CogVM source as per VMMaker.oscog-eem.1623

Spur:
Fix a bug with out-of-place two-way become, which got the hash copy the wrong
way round.  By default, the hash stays with the reference in two-way become.

Fix what appears to be a compiler bug with in-place two-way-become by treating
the headers to be swapped so that remembered flags are swapped and hash bits
are swapped if required.

Cogit:
Execute the "abstract registers simply name concrete registers" coup.  Now
abstract registers are also non-negative values and all the negation nonsense
with register masks is eliminated.

Refactor primitive generation so that all primitives reside in
CogObjectRepresentation and subclasses, except for genPrimitiveClosureValue and
genPrimitivePerform.  This eliminates the outer/inner distinction and the need
for a separate compileFallbackToInterpreterPrimitive:.

Eliminate the enabled function from a CogPrimitiveDescriptor, adding the
enablement calls to the relevant primitives, and discarding the unused
primitiveIndex arguments.

MIPS Cogit: Implement I-cache flush with <asm/cachectl.h>.

Use signed shift when generating I-type instructions.

Handle optional floating-point (i.e. the current MIPSEL) by adding
<option: #DPFPReg0> to all floating point routines hence eliding them on MIPS.

Misc Cogit:
Eliminate some obsolete assignments to maxSize in computeFooSize methods.

Implement machine code SmallFloat primitives.  Fix conversion bug in
maybeGenConvertIfSmallFloatIn:.

Streamline genJumpNotSmallFloatValueBits:scratch:'s isolation of the exponent.

Slang:
Avoid computing variable and return types prematurely i.e. don't derive types
from as-yet-untyped methods.

sqConfig.h:
Add NeverInline support for the Clang C compiler.

Spur Bootstrap for Cuis:
Cope with there being no methodClassAsociation: in MorphFloat.st

Modified Paths:
--------------
    branches/Cog/image/old/MorphFloat.st
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    branches/Cog/nsspursrc/vm/cogitMIPSEL.c
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
    branches/Cog/nsspurstack64src/vm/interp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/platforms/Mac OS/vm/sqConfig.h
    branches/Cog/platforms/iOS/vm/OSX/sqConfig.h
    branches/Cog/platforms/iOS/vm/iPhone/sqConfig.h
    branches/Cog/platforms/unix/vm/sqConfig.h
    branches/Cog/platforms/win32/vm/sqConfig.h
    branches/Cog/spur64src/vm/cogit.h
    branches/Cog/spur64src/vm/cogitX64.c
    branches/Cog/spur64src/vm/cointerp.c
    branches/Cog/spur64src/vm/cointerp.h
    branches/Cog/spur64src/vm/gcc3x-cointerp.c
    branches/Cog/spursistasrc/vm/cogit.h
    branches/Cog/spursistasrc/vm/cogitARMv5.c
    branches/Cog/spursistasrc/vm/cogitIA32.c
    branches/Cog/spursistasrc/vm/cogitMIPSEL.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/cogitMIPSEL.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/cogitMIPSEL.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/image/old/MorphFloat.st
===================================================================
--- branches/Cog/image/old/MorphFloat.st	2015-12-19 02:58:35 UTC (rev 3546)
+++ branches/Cog/image/old/MorphFloat.st	2016-01-09 16:25:07 UTC (rev 3547)
@@ -100,7 +100,9 @@
 		binding := bfc binding.
 		bfc selectorsAndMethodsDo:
 			[:s :m|
-			 m methodClassAssociation: binding].
+			 [m methodClassAssociation: binding]
+				on: MessageNotUnderstood
+				do: [:ex| m literalAt: m numLiterals put: binding]].
 		bfc organization removeEmptyCategories; sortCategories].
 	"shrink method dictionaries after removals; rehash does not shrink :-("
 	{boxedFloat. boxedFloat class} do:
Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-12-19 02:58:35 UTC (rev 3546)
+++ branches/Cog/nsspursrc/vm/cogit.h	2016-01-09 16:25:07 UTC (rev 3547)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1608 uuid: bf1e1bd4-7dd4-47e2-bb33-3a988cc4c276
+	CCodeGenerator VMMaker.oscog-eem.1623 uuid: 796c33c7-b025-4e0c-bd4e-1d3fa3d71f22
  */
 
 

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-12-19 02:58:35 UTC (rev 3546)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2016-01-09 16:25:07 UTC (rev 3547)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1608 uuid: bf1e1bd4-7dd4-47e2-bb33-3a988cc4c276
+	CCodeGenerator VMMaker.oscog-eem.1621 uuid: 45817ea7-f2d1-4538-bfe4-c748be944bf2
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1608 uuid: bf1e1bd4-7dd4-47e2-bb33-3a988cc4c276
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1621 uuid: 45817ea7-f2d1-4538-bfe4-c748be944bf2
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1608 uuid: bf1e1bd4-7dd4-47e2-bb33-3a988cc4c276 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1621 uuid: 45817ea7-f2d1-4538-bfe4-c748be944bf2 " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -78,7 +78,6 @@
 typedef struct {
 	sqInt (*primitiveGenerator )(void);
 	sqInt	primNumArgs;
-	sqInt (*enabled )(sqInt);
  } PrimitiveDescriptor;
 
 #define CogPrimitiveDescriptor PrimitiveDescriptor
@@ -129,8 +128,8 @@
 #define AndOpcode 0
 #define AndRR 91
 #define AnnotationShift 5
-#define Arg0Reg -7
-#define Arg1Reg -8
+#define Arg0Reg 4
+#define Arg1Reg 5
 #define ArithmeticShiftRightCqR 80
 #define ArithmeticShiftRightRR 81
 #define BadRegisterSet 1
@@ -148,7 +147,7 @@
 #define ClassBlockClosureCompactIndex 37
 #define ClassFloatCompactIndex 34
 #define ClassMethodContextCompactIndex 36
-#define ClassReg -5
+#define ClassReg 8
 #define ClosureFirstCopiedValueIndex 3
 #define ClosureIndex 4
 #define ClosureNumArgsIndex 2
@@ -174,39 +173,25 @@
 #define ConstZero 1
 #define ConvertRRd 115
 #define CS 2
-#define D0 0
-#define D1 1
-#define D2 2
-#define D3 3
-#define D4 4
-#define D5 5
-#define D6 6
-#define D7 7
 #define Debug DEBUGVM
 #define DisplacementMask 0x1F
 #define DisplacementX2N 0
 #define DivRdRd 113
-#define DPFPReg0 -21
-#define DPFPReg1 -22
-#define DPFPReg2 -23
-#define DPFPReg3 -24
-#define DPFPReg4 -25
-#define DPFPReg5 -26
-#define DPFPReg6 -27
-#define DPFPReg7 -28
+#define DPFPReg0 0
+#define DPFPReg1 1
+#define DPFPReg2 2
 #define EncounteredUnknownBytecode -6
 #define EQ 0
 #define Fill32 4
 #define FirstAnnotation 64
 #define FirstJump 11
-#define FirstShortJump 15
 #define FirstSpecialSelector 176
 #define FoxCallerSavedIP 4
 #define FoxMethod -4
 #define FoxMFReceiver -12
 #define FoxSavedFP 0
 #define FoxThisContext -8
-#define FPReg -1
+#define FPReg 11
 #define GCModeBecome 8
 #define GCModeFull 1
 #define GCModeNewSpace 2
@@ -215,6 +200,7 @@
 #define HasBytecodePC 4
 #define HeaderIndex 0
 #define HI 8
+#define IMMUTABILITY 0
 #define InstanceSpecificationIndex 2
 #define InstructionPointerIndex 1
 #define InsufficientCodeSpace -2
@@ -263,7 +249,7 @@
 #define LargeContextSlots 62
 #define LastJump 39
 #define LE 13
-#define LinkReg -17
+#define LinkReg 14
 #define Literal 2
 #define LiteralStart 1
 #define LoadEffectiveAddressMwrR 77
@@ -323,7 +309,7 @@
 #define NegateR 79
 #define NewspeakVM 1
 #define Nop 5
-#define NoReg null
+#define NoReg -1
 #define NotFullyInitialized -1
 #define NSCClassTagIndex 0
 #define NSCEnclosingObjectIndex 1
@@ -339,7 +325,7 @@
 #define OrOpcode 12
 #define OrRR 92
 #define PC 15
-#define PCReg -19
+#define PCReg 15
 #define PL 5
 #define PopR 72
 #define PrefetchAw 76
@@ -353,29 +339,22 @@
 #define PushCw 75
 #define PushR 73
 #define R0 0
-#define R11 11
-#define R12 12
-#define R4 4
-#define R5 5
-#define R6 6
-#define R7 7
-#define R8 8
 #define ReceiverIndex 5
-#define ReceiverResultReg -3
+#define ReceiverResultReg 7
 #define RetN 8
-#define RISCTempReg -18
+#define RISCTempReg 12
 #define RsbOpcode 3
-#define Scratch0Reg -9
+#define Scratch0Reg 12
 #define SelectorCannotInterpret 34
 #define SelectorDoesNotUnderstand 20
 #define SenderIndex 0
-#define SendNumArgsReg -6
+#define SendNumArgsReg 6
 #define ShouldNotJIT -8
 #define SistaVM 0
 #define SMULL 116
 #define SmallContextSlots 22
 #define SP 13
-#define SPReg -2
+#define SPReg 13
 #define SqrtRd 114
 #define SSBaseOffset 1
 #define SSConstant 2
@@ -388,13 +367,13 @@
 #define SubOpcode 2
 #define SubRdRd 111
 #define SubRR 90
-#define TempReg -4
+#define TempReg 0
 #define TstCqR 99
 #define TstOpcode 8
 #define UnfailingPrimitive 3
 #define UnimplementedPrimitive -7
 #define ValueIndex 1
-#define VarBaseReg -20
+#define VarBaseReg 10
 #define VC 7
 #define VS 6
 #define XorCqR 100
@@ -434,7 +413,6 @@
 static sqInt NoDbgRegParms isAFixup(AbstractInstruction * self_in_isAFixup, void *fixupOrAddress);
 static sqInt NoDbgRegParms isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction);
 static sqInt NoDbgRegParms isJump(AbstractInstruction * self_in_isJump);
-static sqInt NoDbgRegParms isLongJump(AbstractInstruction * self_in_isLongJump);
 static sqInt NoDbgRegParms isWithinMwOffsetRange(AbstractInstruction * self_in_isWithinMwOffsetRange, sqInt anAddress);
 static AbstractInstruction * NoDbgRegParms jmpTarget(AbstractInstruction * self_in_jmpTarget, AbstractInstruction *anAbstractInstruction);
 static usqInt NoDbgRegParms labelOffset(AbstractInstruction * self_in_labelOffset);
@@ -445,7 +423,6 @@
 static AbstractInstruction * NoDbgRegParms resolveJumpTarget(AbstractInstruction * self_in_resolveJumpTarget);
 static sqInt NoDbgRegParms rewriteConditionalJumpLongAttarget(AbstractInstruction * self_in_rewriteConditionalJumpLongAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress);
 static sqInt NoDbgRegParms setLabelOffset(AbstractInstruction * self_in_setLabelOffset, sqInt aValue);
-static sqInt NoDbgRegParms abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg);
 static sqInt NoDbgRegParms addsrnimmror(AbstractInstruction * self_in_addsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot);
 static sqInt NoDbgRegParms addrnimmror(AbstractInstruction * self_in_addrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot);
 static sqInt NoDbgRegParms addrnrm(AbstractInstruction * self_in_addrnrm, sqInt destReg, sqInt srcReg, sqInt addReg);
@@ -462,8 +439,6 @@
 static sqInt NoDbgRegParms computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize);
 static sqInt NoDbgRegParms concreteCalleeSavedRegisterMask(AbstractInstruction * self_in_concreteCalleeSavedRegisterMask);
 static sqInt NoDbgRegParms concreteCallerSavedRegisterMask(AbstractInstruction * self_in_concreteCallerSavedRegisterMask);
-static sqInt NoDbgRegParms concreteDPFPRegister(AbstractInstruction * self_in_concreteDPFPRegister, sqInt registerIndex);
-static sqInt NoDbgRegParms concreteRegister(AbstractInstruction * self_in_concreteRegister, sqInt registerIndex);
 static sqInt NoDbgRegParms concretizeAt(AbstractInstruction * self_in_concretizeAt, sqInt actualAddress);
 static usqInt NoDbgRegParms concretizeCMPSMULL(AbstractInstruction * self_in_concretizeCMPSMULL);
 static void NoDbgRegParms concretizeConditionalInstruction(AbstractInstruction * self_in_concretizeConditionalInstruction);
@@ -471,7 +446,6 @@
 static usqInt NoDbgRegParms concretizeMSR(AbstractInstruction * self_in_concretizeMSR);
 static usqInt NoDbgRegParms concretizeSMULL(AbstractInstruction * self_in_concretizeSMULL);
 static sqInt NoDbgRegParms conditionIsNotNever(AbstractInstruction * self_in_conditionIsNotNever, sqInt instr);
-static sqInt NoDbgRegParms cResultRegister(AbstractInstruction * self_in_cResultRegister);
 static sqInt NoDbgRegParms dataOpTyperdrnrmlsr(AbstractInstruction * self_in_dataOpTyperdrnrmlsr, sqInt armOpcode, sqInt destReg, sqInt srcReg, sqInt addReg, sqInt shft);
 static void NoDbgRegParms dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize);
 static sqInt NoDbgRegParms fmsrFromto(AbstractInstruction * self_in_fmsrFromto, sqInt regA, sqInt regB);
@@ -488,7 +462,8 @@
 static sqInt NoDbgRegParms genRemoveNArgsFromStack(AbstractInstruction * self_in_genRemoveNArgsFromStack, sqInt n);
 static AbstractInstruction * NoDbgRegParms genRestoreRegs(AbstractInstruction * self_in_genRestoreRegs);
 static AbstractInstruction * NoDbgRegParms genRestoreRegsExcept(AbstractInstruction * self_in_genRestoreRegsExcept, sqInt abstractReg);
-static AbstractInstruction * NoDbgRegParms genSaveRegisters(AbstractInstruction * self_in_genSaveRegisters);
+static AbstractInstruction * NoDbgRegParms genSaveRegForCCall(AbstractInstruction * self_in_genSaveRegForCCall);
+static AbstractInstruction * NoDbgRegParms genSaveRegsForCCall(AbstractInstruction * self_in_genSaveRegsForCCall);
 static sqInt NoDbgRegParms genSaveStackPointers(AbstractInstruction * self_in_genSaveStackPointers);
 static AbstractInstruction * NoDbgRegParms genSubstituteReturnAddress(AbstractInstruction * self_in_genSubstituteReturnAddress, sqInt retpc);
 static sqInt NoDbgRegParms hasLinkRegister(AbstractInstruction * self_in_hasLinkRegister);
@@ -625,7 +600,6 @@
 static void compileEntry(void);
 static sqInt compileMethodBody(void);
 static sqInt NoDbgRegParms compilePICAbort(sqInt numArgs);
-static sqInt compilePrimitive(void);
 static void NoDbgRegParms compileTrampolineFornumArgsargargargargsaveRegspushLinkRegresultReg(void *aRoutine, sqInt numArgs, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3, sqInt saveRegs, sqInt pushLinkReg, sqInt resultRegOrNone);
 static void computeEntryOffsets(void);
 static void computeMaximumSizes(void);
@@ -681,6 +655,7 @@
 static sqInt NoDbgRegParms genSafeTrampolineForcalledargarg(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1);
 static sqInt NoDbgRegParms genSmalltalkToCStackSwitch(sqInt pushLinkReg);
 static sqInt NoDbgRegParms genTrampolineForcalled(void *aRoutine, char *aString);
+static sqInt NoDbgRegParms genTrampolineForcalledargargarg(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2);
 static sqInt NoDbgRegParms genTrampolineForcalledargargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt resultReg);
 static sqInt NoDbgRegParms genTrampolineForcalledargargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt resultReg);
 static sqInt NoDbgRegParms genTrampolineForcalledargresult(void *aRoutine, char *aString, sqInt regOrConst0, sqInt resultReg);
@@ -738,12 +713,14 @@
 static sqInt maybeAllocAndInitIRCs(void);
 static sqInt NoDbgRegParms maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod);
 static void NoDbgRegParms maybeMarkCountersIn(CogMethod *cogMethod);
-static sqInt NoDbgRegParms mclassIsSmallInteger(sqInt ignoredPrimIndex);
+static sqInt mclassIsSmallInteger(void);
 extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
+static sqInt methodNumArgs(void);
 static sqInt NoDbgRegParms methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral);
 extern sqInt minCogMethodAddress(void);
 extern sqInt mnuOffset(void);
 static AbstractInstruction * NoDbgRegParms gNegateR(sqInt reg);
+static sqInt NoDbgRegParms needsFrameIfImmutability(sqInt stackDelta);
 static sqInt NoDbgRegParms needsFrameIfInBlock(sqInt stackDelta);
 static sqInt NoDbgRegParms needsFrameNever(sqInt stackDelta);
 static sqInt NoDbgRegParms noAssertMethodClassAssociationOf(sqInt methodPointer);
@@ -757,15 +734,10 @@
 static sqInt picAbortDiscriminatorValue(void);
 static sqInt picInterpretAbortOffset(void);
 static AbstractInstruction * previousInstruction(void);
-static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
 extern void printCogMethodFor(void *address);
 extern void printTrampolineTable(void);
-static sqInt NoDbgRegParms processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex);
-static sqInt NoDbgRegParms processorHasDivQuoRem(sqInt ignoredPrimIndex);
-static sqInt NoDbgRegParms processorHasDoublePrecisionFloatingPointSupport(sqInt ignoredPrimIndex);
-static sqInt NoDbgRegParms processorHasMultiplyAndMClassIsSmallInteger(sqInt ignoredPrimIndex);
-static sqInt NoDbgRegParms processorHasMultiply(sqInt ignoredPrimIndex);
-static AbstractInstruction * NoDbgRegParms gRetN(sqInt offset);
+static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(void);
+static sqInt processorHasMultiplyAndMClassIsSmallInteger(void);
 static void NoDbgRegParms recordGeneratedRunTimeaddress(char *aString, sqInt address);
 extern sqInt recordPrimTraceFunc(void);
 static void recordRunTimeObjectReferences(void);
@@ -784,9 +756,9 @@
 extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop);
 static sqInt NoDbgRegParms spanForCleanBlockStartingAt(sqInt startPC);
 extern sqInt traceLinkedSendOffset(void);
+static sqInt NoDbgRegParms trampolineArgConstant(sqInt booleanOrInteger);
 static char * NoDbgRegParms trampolineNamenumArgs(char *routinePrefix, sqInt numArgs);
 static char * NoDbgRegParms trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs);
-static sqInt unimplementedPrimitive(void);
 static sqInt unknownBytecode(void);
 extern void unlinkAllSends(void);
 static sqInt NoDbgRegParms unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector);
@@ -836,9 +808,45 @@
 static sqInt NoDbgRegParms checkValidObjectReference(sqInt anOop);
 static AbstractInstruction * NoDbgRegParms genCmpClassFloatCompactIndexR(sqInt reg);
 static AbstractInstruction * NoDbgRegParms genCmpClassMethodContextCompactIndexR(sqInt reg);
-static sqInt NoDbgRegParms genInnerPrimitiveNewMethod(sqInt retNoffset);
+static sqInt NoDbgRegParms genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg));
+static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction *(*jumpOpcodeGenerator)(void *), sqInt invertComparison);
 static AbstractInstruction * NoDbgRegParms genJumpSmallIntegerscratchReg(sqInt aRegister, sqInt scratch);
 static sqInt NoDbgRegParms genLoadSlotsourceRegdestReg(sqInt index, sqInt sourceReg, sqInt destReg);
+static sqInt genPrimitiveAdd(void);
+static sqInt genPrimitiveAsFloat(void);
+static sqInt genPrimitiveBitAnd(void);
+static sqInt genPrimitiveBitOr(void);
+static sqInt genPrimitiveBitShift(void);
+static sqInt genPrimitiveBitXor(void);
+static sqInt genPrimitiveClass(void);
+static sqInt genPrimitiveDiv(void);
+static sqInt genPrimitiveDivide(void);
+static sqInt genPrimitiveEqual(void);
+static sqInt genPrimitiveFloatAdd(void);
+static sqInt genPrimitiveFloatDivide(void);
+static sqInt genPrimitiveFloatEqual(void);
+static sqInt genPrimitiveFloatGreaterOrEqual(void);
+static sqInt genPrimitiveFloatGreaterThan(void);
+static sqInt genPrimitiveFloatLessOrEqual(void);
+static sqInt genPrimitiveFloatLessThan(void);
+static sqInt genPrimitiveFloatMultiply(void);
+static sqInt genPrimitiveFloatNotEqual(void);
+static sqInt genPrimitiveFloatSquareRoot(void);
+static sqInt genPrimitiveFloatSubtract(void);
+static sqInt genPrimitiveGreaterOrEqual(void);
+static sqInt genPrimitiveGreaterThan(void);
+static sqInt genPrimitiveIdentical(void);
+static sqInt genPrimitiveLessOrEqual(void);
+static sqInt genPrimitiveLessThan(void);
+static sqInt genPrimitiveMod(void);
+static sqInt genPrimitiveMultiply(void);
+static sqInt genPrimitiveNewMethod(void);
+static sqInt genPrimitiveNotEqual(void);
+static sqInt genPrimitiveNotIdentical(void);
+static sqInt genPrimitiveQuo(void);
+static sqInt genPrimitiveSubtract(void);
+static sqInt NoDbgRegParms genSmallIntegerComparison(sqInt jumpOpcode);
+static sqInt NoDbgRegParms genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction *(*jumpFPOpcodeGenerator)(void *), sqInt invertComparison);
 static sqInt NoDbgRegParms isUnannotatableConstant(CogSimStackEntry *simStackEntry);
 static sqInt NoDbgRegParms maybeGenConvertIfSmallFloatInscratchRegintoandJumpTo(sqInt oopReg, sqInt scratch, sqInt dpReg, AbstractInstruction *targetInst);
 static sqInt NoDbgRegParms genAddSmallIntegerTagsTo(sqInt aRegister);
@@ -852,19 +860,19 @@
 static sqInt NoDbgRegParms genGetHashFieldNonImmOfinto(sqInt instReg, sqInt destReg);
 static AbstractInstruction * NoDbgRegParms genGetInlineCacheClassTagFromintoforEntry(sqInt sourceReg, sqInt destReg, sqInt forEntry);
 static sqInt NoDbgRegParms genGetOverflowSlotsOfinto(sqInt srcReg, sqInt destReg);
-static sqInt NoDbgRegParms genInnerPrimitiveAtPut(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveAt(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveIdentityHash(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveMirrorNewWithArg(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveMirrorNew(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveNewWithArg(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveNew(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveStringAtPut(sqInt retNoffset);
 static AbstractInstruction * NoDbgRegParms genJumpIsSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg);
 static AbstractInstruction * NoDbgRegParms genJumpNotSmallIntegerInScratchReg(sqInt aRegister);
 static AbstractInstruction * NoDbgRegParms genJumpNotSmallIntegerValuescratch(sqInt aRegister, sqInt scratchReg);
 static AbstractInstruction * NoDbgRegParms genJumpNotSmallInteger(sqInt aRegister);
 static AbstractInstruction * NoDbgRegParms genJumpSmallInteger(sqInt aRegister);
+static sqInt genPrimitiveAt(void);
+static sqInt genPrimitiveAtPut(void);
+static sqInt genPrimitiveIdentityHash(void);
+static sqInt genPrimitiveMirrorNew(void);
+static sqInt genPrimitiveMirrorNewWithArg(void);
+static sqInt genPrimitiveNew(void);
+static sqInt genPrimitiveNewWithArg(void);
+static sqInt genPrimitiveStringAtPut(void);
 static sqInt NoDbgRegParms genRemoveSmallIntegerTagsInScratchReg(sqInt scratchReg);
 static sqInt NoDbgRegParms genShiftAwaySmallIntegerTagsInScratchReg(sqInt scratchReg);
 static sqInt NoDbgRegParms inlineCacheTagForInstance(sqInt oop);
@@ -904,21 +912,20 @@
 static sqInt NoDbgRegParms genGetFormatOfintoleastSignificantHalfOfBaseHeaderIntoScratch(sqInt sourceReg, sqInt destReg, sqInt scratchRegOrNone);
 static sqInt NoDbgRegParms genGetNumSlotsOfinto(sqInt srcReg, sqInt destReg);
 static sqInt NoDbgRegParms genGetRawSlotSizeOfNonImminto(sqInt sourceReg, sqInt destReg);
-static sqInt NoDbgRegParms genInnerPrimitiveAsCharacterinReg(sqInt retNOffset, sqInt reg);
-static sqInt NoDbgRegParms genInnerPrimitiveCharacterValue(sqInt retNOffset);
-static sqInt NoDbgRegParms genInnerPrimitiveIdenticalorNotIf(sqInt retNoffset, sqInt orNot);
-static sqInt NoDbgRegParms genInnerPrimitiveObjectAt(sqInt retNOffset);
-static sqInt NoDbgRegParms genInnerPrimitiveSize(sqInt retNoffset);
-static sqInt NoDbgRegParms genInnerPrimitiveStringAt(sqInt retNoffset);
 static AbstractInstruction * NoDbgRegParms genJumpImmediate(sqInt aRegister);
 static AbstractInstruction * NoDbgRegParms genJumpNotCharacterInScratchReg(sqInt reg);
 static sqInt NoDbgRegParms genNewArrayOfSizeinitialized(sqInt size, sqInt initialized);
 static sqInt NoDbgRegParms genNoPopCreateClosureAtnumArgsnumCopiedcontextNumArgslargeinBlock(sqInt bcpc, sqInt numArgs, sqInt numCopied, sqInt ctxtNumArgs, sqInt isLargeCtxt, sqInt isInBlock);
+static sqInt genPrimitiveAsCharacter(void);
+static sqInt genPrimitiveCharacterValue(void);
+static sqInt NoDbgRegParms genPrimitiveIdenticalOrNotIf(sqInt orNot);
+static sqInt genPrimitiveObjectAt(void);
+static sqInt genPrimitiveSize(void);
+static sqInt genPrimitiveStringAt(void);
 static sqInt NoDbgRegParms genSetSmallIntegerTagsIn(sqInt scratchReg);
 static sqInt genStoreCheckContextReceiverTrampoline(void);
 static sqInt NoDbgRegParms genStoreCheckReceiverRegvalueRegscratchReginFrame(sqInt destReg, sqInt valueReg, sqInt scratchReg, sqInt inFrame);
-static sqInt NoDbgRegParms genStoreImmediateInSourceRegslotIndexdestReg(sqInt sourceReg, sqInt index, sqInt destReg);
-static sqInt NoDbgRegParms genStoreSourceRegslotIndexdestRegscratchReginFrame(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame);
+static sqInt NoDbgRegParms genStoreSourceRegslotIndexdestRegscratchReginFrameneedsStoreCheck(sqInt sourceReg, sqInt index, sqInt destReg, sqInt scratchReg, sqInt inFrame, sqInt needsStoreCheck);
 static sqInt NoDbgRegParms genStoreSourceRegslotIndexintoNewObjectInDestReg(sqInt sourceReg, sqInt index, sqInt destReg);
 static sqInt getActiveContextAllocatesInMachineCode(void);
 static sqInt hasSpurMemoryManagerAPI(void);
@@ -970,12 +977,12 @@
 static sqInt resetForBlockCompile(void);
 static sqInt saveForBlockCompile(void);
 static sqInt compileBlockDispatch(void);
-static sqInt NoDbgRegParms compileFallbackToInterpreterPrimitive(sqInt code);
 static void compileGetErrorCode(void);
 static sqInt NoDbgRegParms compileInterpreterPrimitive(void (*primitiveRoutine)(void));
 static AbstractInstruction * NoDbgRegParms compileOpenPICMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selector, sqInt shift, sqInt baseRegOrNone);
 static void NoDbgRegParms compileOpenPICnumArgs(sqInt selector, sqInt numArgs);
 static AbstractInstruction * NoDbgRegParms compilePerformMethodCacheProbeForwithShiftbaseRegOrNone(sqInt selectorReg, sqInt shift, sqInt baseRegOrNone);
+static sqInt compilePrimitive(void);
 static sqInt extendedPushBytecode(void);
 static sqInt extendedStoreAndPopBytecode(void);
 static sqInt extendedStoreBytecode(void);
@@ -1015,24 +1022,8 @@
 static sqInt genLongUnconditionalForwardJump(void);
 static sqInt NoDbgRegParms genLookupForPerformNumArgs(sqInt numArgs);
 static AbstractInstruction * NoDbgRegParms genMoveConstantR(sqInt constant, sqInt reg);
-static AbstractInstruction * NoDbgRegParms genMoveTrueR(sqInt reg);
+static sqInt NoDbgRegParms genMoveTrueR(sqInt reg);
 static sqInt NoDbgRegParms genMustBeBooleanTrampolineForcalled(sqInt boolean, char *trampolineName);
-static sqInt genPrimitiveEqual(void);
-static sqInt genPrimitiveFloatAdd(void);
-static sqInt genPrimitiveFloatDivide(void);
-static sqInt genPrimitiveFloatEqual(void);
-static sqInt genPrimitiveFloatGreaterOrEqual(void);
-static sqInt genPrimitiveFloatGreaterThan(void);
-static sqInt genPrimitiveFloatLessOrEqual(void);
-static sqInt genPrimitiveFloatLessThan(void);
-static sqInt genPrimitiveFloatMultiply(void);
-static sqInt genPrimitiveFloatNotEqual(void);
-static sqInt genPrimitiveFloatSubtract(void);
-static sqInt genPrimitiveGreaterOrEqual(void);
-static sqInt genPrimitiveGreaterThan(void);
-static sqInt genPrimitiveLessOrEqual(void);
-static sqInt genPrimitiveLessThan(void);
-static sqInt genPrimitiveNotEqual(void);
 static void NoDbgRegParms genPrimReturnEnterCogCodeEnilopmart(sqInt profiling);
 static sqInt genPushClosureTempsBytecode(void);
 static sqInt genPushConstantFalseBytecode(void);
@@ -1073,6 +1064,7 @@
 static void maybeCompileAllocFillerCheck(void);
 static sqInt methodUsesPrimitiveErrorCode(void);
 static sqInt numSpecialSelectors(void);
+static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
 extern void recordCallOffsetIn(CogMethod *cogMethod);
 static sqInt NoDbgRegParms registerisInMask(sqInt reg, sqInt mask);
 static sqInt returnRegForStoreCheck(void);
@@ -1110,8 +1102,6 @@
 static sqInt NoDbgRegParms freeAnyRegNotConflictingWith(sqInt regMask);
 static void (*genCallPICEnilopmartNumArgs(sqInt numArgs))(void) ;
 static sqInt genCallPrimitiveBytecode(void);
-static sqInt NoDbgRegParms genDoubleArithmeticpreOpCheck(sqInt arithmeticOperator, AbstractInstruction *(*preOpCheckOrNil)(int rcvrReg, int argReg));
-static sqInt NoDbgRegParms genDoubleComparisoninvert(AbstractInstruction *(*jumpOpcodeGenerator)(void *), sqInt invertComparison);
 static sqInt NoDbgRegParms genEqualsEqualsNoBranchArgIsConstantrcvrIsConstantargRegrcvrReg(sqInt argIsConstant, sqInt rcvrIsConstant, sqInt argReg, sqInt rcvrRegOrNone);
 static sqInt genExternalizePointersForPrimitiveCall(void);
 static sqInt genExtPushClosureBytecode(void);
@@ -1128,36 +1118,9 @@
 static sqInt NoDbgRegParms genPICAbortTrampolineFor(sqInt numArgs);
 static sqInt NoDbgRegParms genPICMissTrampolineFor(sqInt numArgs);
 static sqInt genPopStackBytecode(void);
-static sqInt genPrimitiveAdd(void);
-static sqInt genPrimitiveAsCharacter(void);
-static sqInt genPrimitiveAsFloat(void);
-static sqInt genPrimitiveAt(void);
-static sqInt genPrimitiveAtPut(void);
-static sqInt genPrimitiveBitAnd(void);
-static sqInt genPrimitiveBitOr(void);
-static sqInt genPrimitiveBitShift(void);
-static sqInt genPrimitiveBitXor(void);
-static sqInt genPrimitiveCharacterValue(void);
-static sqInt genPrimitiveClass(void);
 static sqInt genPrimitiveClosureValue(void);
-static sqInt genPrimitiveDiv(void);
-static sqInt genPrimitiveDivide(void);
-static sqInt genPrimitiveFloatSquareRoot(void);
-static sqInt genPrimitiveIdentical(void);
-static sqInt genPrimitiveIdentityHash(void);
-static sqInt genPrimitiveMod(void);
-static sqInt genPrimitiveMultiply(void);
-static sqInt genPrimitiveNew(void);
-static sqInt genPrimitiveNewMethod(void);
-static sqInt genPrimitiveNewWithArg(void);
-static sqInt genPrimitiveNotIdentical(void);
-static sqInt genPrimitiveObjectAt(void);
 static sqInt genPrimitivePerform(void);
-static sqInt genPrimitiveQuo(void);
-static sqInt genPrimitiveSize(void);
-static sqInt genPrimitiveStringAt(void);
-static sqInt genPrimitiveStringAtPut(void);
-static sqInt genPrimitiveSubtract(void);
+static AbstractInstruction * genPrimReturn(void);
 static sqInt genPushActiveContextBytecode(void);
 static sqInt genPushClosureCopyCopiedValuesBytecode(void);
 static sqInt NoDbgRegParms genPushEnclosingObjectAt(sqInt level);
@@ -1177,8 +1140,6 @@
 static sqInt NoDbgRegParms genSendSupernumArgs(sqInt selectorIndex, sqInt numArgs);
 static sqInt NoDbgRegParms genSendTrampolineFornumArgscalledargargargarg(void *aRoutine, sqInt numArgs, char *aString, sqInt regOrConst0, sqInt regOrConst1, sqInt regOrConst2, sqInt regOrConst3);
 static sqInt NoDbgRegParms genSendnumArgs(sqInt selectorIndex, sqInt numArgs);
-static sqInt NoDbgRegParms genSmallIntegerComparison(sqInt jumpOpcode);
-static sqInt NoDbgRegParms genSmallIntegerComparisonorDoubleComparisoninvert(sqInt jumpOpcode, AbstractInstruction *(*jumpFPOpcodeGenerator)(void *), sqInt invertComparison);
 static sqInt genSpecialSelectorArithmetic(void);
 static sqInt genSpecialSelectorClass(void);
 static sqInt genSpecialSelectorComparison(void);
@@ -1227,6 +1188,7 @@
 static sqInt NoDbgRegParms ssPushDesc(CogSimStackEntry simStackEntry);
 static sqInt NoDbgRegParms ssPushRegister(sqInt reg);
 static void NoDbgRegParms ssPush(sqInt n);
+static void NoDbgRegParms ssStoreAndReplacePoptoReg(sqInt popBoolean, sqInt reg);
 static sqInt NoDbgRegParms ssStorePoptoPreferredReg(sqInt popBoolean, sqInt preferredReg);
 static void NoDbgRegParms ssStorePoptoReg(sqInt popBoolean, sqInt reg);
 static CogSimStackEntry * ssTop(void);
@@ -1268,6 +1230,7 @@
 void (*ceCallCogCodePopReceiverArg0Regs)(void);
 void (*ceCallCogCodePopReceiverArg1Arg0Regs)(void);
 void (*ceCallCogCodePopReceiverReg)(void);
+static sqInt ceCannotAssignToWithIndexTrampoline;
 sqInt ceCannotResumeTrampoline;
 void (*ceCaptureCStackPointers)(void);
 static unsigned long (*ceCheckFeaturesFunction)(void);
@@ -1430,14 +1393,14 @@
 	{ genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genPushLiteralVariableBytecode, 0, needsFrameNever, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
 	{ genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -1766,14 +1729,14 @@
 	{ genSendAbsentImplicit0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
 	{ genSendAbsentImplicit0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
 	{ genSendAbsentImplicit0ArgsBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
-	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameNever, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
+	{ genStoreAndPopReceiverVariableBytecode, 0, needsFrameIfImmutability, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0 },
 	{ genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
 	{ genStoreAndPopTemporaryVariableBytecode, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
@@ -2098,7 +2061,7 @@
 {
     sqInt cResultReg;
 
-	cResultReg = cResultRegister(self_in_genWriteCResultIntoReg);
+	cResultReg = R0;
 	if (abstractRegister != cResultReg) {
 		genoperandoperand(MoveRR, cResultReg, abstractRegister);
 	}
@@ -2191,14 +2154,7 @@
 	return ((((self_in_isJump->opcode)) >= FirstJump) && (((self_in_isJump->opcode)) <= LastJump));
 }
 
-	/* CogAbstractInstruction>>#isLongJump */
-static sqInt NoDbgRegParms
-isLongJump(AbstractInstruction * self_in_isLongJump)
-{
-	return ((((self_in_isLongJump->opcode)) >= FirstJump) && (((self_in_isLongJump->opcode)) <= (FirstShortJump - 1)));
-}
 
-
 /*	Answer if an address can be accessed using the offset in a MoveMw:r:R: or
 	similar instruction.
 	We assume this is true for 32-bit processors and expect 64-bit processors
@@ -2329,54 +2285,7 @@
 	return ((self_in_setLabelOffset->operands))[1] = aValue;
 }
 
-	/* CogARMCompiler>>#abstractRegisterForConcreteRegister: */
-static sqInt NoDbgRegParms
-abstractRegisterForConcreteRegister(AbstractInstruction * self_in_abstractRegisterForConcreteRegister, sqInt reg)
-{
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, TempReg)) == reg) {
-		return TempReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, ReceiverResultReg)) == reg) {
-		return ReceiverResultReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, ClassReg)) == reg) {
-		return ClassReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, SendNumArgsReg)) == reg) {
-		return SendNumArgsReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, Arg0Reg)) == reg) {
-		return Arg0Reg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, Arg1Reg)) == reg) {
-		return Arg1Reg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, FPReg)) == reg) {
-		return FPReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, SPReg)) == reg) {
-		return SPReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, LinkReg)) == reg) {
-		return LinkReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, RISCTempReg)) == reg) {
-		return RISCTempReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, PCReg)) == reg) {
-		return PCReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, VarBaseReg)) == reg) {
-		return VarBaseReg;
-	}
-	if ((concreteRegister(self_in_abstractRegisterForConcreteRegister, Scratch0Reg)) == reg) {
-		return Scratch0Reg;
-	}
-	error("could not find abstract register");
-	return 0;
-}
 
-
 /*	Remember the ROR is doubled by the cpu so use 30>>1 etc
 	ADDS destReg, srcREg, #immediate ROR #rot */
 
@@ -2509,7 +2418,7 @@
 static sqInt NoDbgRegParms
 callerSavedRegisterMask(AbstractInstruction * self_in_callerSavedRegisterMask)
 {
-	return registerMaskForand(abstractRegisterForConcreteRegister(self_in_callerSavedRegisterMask, 0), abstractRegisterForConcreteRegister(self_in_callerSavedRegisterMask, 12));
+	return registerMaskForand(0, 12);
 }
 
 
@@ -2853,117 +2762,6 @@
 }
 
 
-/*	Map a possibly abstract double-precision floating-point register into a
-	concrete one.
-	Abstract registers (defined in CogAbstractOpcodes) are all negative. If
-	registerIndex is negative assume it is an abstract register. */
-
-	/* CogARMCompiler>>#concreteDPFPRegister: */
-static sqInt NoDbgRegParms
-concreteDPFPRegister(AbstractInstruction * self_in_concreteDPFPRegister, sqInt registerIndex)
-{
-	
-	switch (registerIndex) {
-	case DPFPReg0:
-		return D0;
-
-	case DPFPReg1:
-		return D1;
-
-	case DPFPReg2:
-		return D2;
-
-	case DPFPReg3:
-		return D3;
-
-	case DPFPReg4:
-		return D4;
-
-	case DPFPReg5:
-		return D5;
-
-	case DPFPReg6:
-		return D6;
-
-	case DPFPReg7:
-		return D7;
-
-	default:
-		assert(((registerIndex >= D0) && (registerIndex <= D7)));
-		return registerIndex;
-
-	}
-}
-
-
-/*	Map a possibly abstract register into a concrete one. Abstract registers
-	(defined in CogAbstractOpcodes) are all negative. If registerIndex is
-	negative assume it is an abstract register. */
-/*	N.B. According to BSABI, R0-R3 are caller-save, R4-R12 are callee save.
-	Note that R9 might be a special register for the implementation. In some
-	slides it is refered to as sb. R10 can contain the stack limit (sl), R11
-	the fp. R12 is an
-	intra-procedure scratch instruction pointer for link purposes. It can also
-	be used.
-	R10 is used as temporary inside a single abstract opcode implementation */
-/*	R0-R3 are used when calling back to the interpreter. Using them would
-	require saving and restoring their values, so they are omitted so far. R12
-	is the only
-	scratch register at the moment.. */
-
-	/* CogARMCompiler>>#concreteRegister: */
-static sqInt NoDbgRegParms
-concreteRegister(AbstractInstruction * self_in_concreteRegister, sqInt registerIndex)
-{
-	
-	switch (registerIndex) {
-	case TempReg:
-		return R0;
-
-	case ClassReg:
-		return R8;
-
-	case ReceiverResultReg:
-		return R7;
-
-	case SendNumArgsReg:
-		return R6;
-
-	case SPReg:
-		return SP;
-
-	case FPReg:
-		return R11;
-
-	case Arg0Reg:
-		return R4;
-
-	case Arg1Reg:
-		return R5;
-
-	case VarBaseReg:
-		return ConcreteVarBaseReg;
-
-	case RISCTempReg:
-		return ConcreteIPReg;
-
-	case Scratch0Reg:
-		return R12;
-
-	case LinkReg:
-		return LR;
-
-	case PCReg:
-		return PC;
-
-	default:
-		assert(((registerIndex >= R0) && (registerIndex <= PC)));
-		return registerIndex;
-
-	}
-}
-
-
 /*	Generate concrete machine code for the instruction at actualAddress,
 	setting machineCodeSize, and answer the following address. */
 /*	Generate concrete machine code for the instruction at actualAddress,
@@ -2990,13 +2788,15 @@
 static usqInt NoDbgRegParms
 concretizeCMPSMULL(AbstractInstruction * self_in_concretizeCMPSMULL)
 {
-    sqInt hiReg;
-    sqInt loReg;
+    sqInt aWord;
+    unsigned long hiReg;
+    unsigned long loReg;
 
-	hiReg = concreteRegister(self_in_concretizeCMPSMULL, ((self_in_concretizeCMPSMULL->operands))[0]);
-	loReg = concreteRegister(self_in_concretizeCMPSMULL, ((self_in_concretizeCMPSMULL->operands))[1]);
+	hiReg = ((self_in_concretizeCMPSMULL->operands))[0];
+	loReg = ((self_in_concretizeCMPSMULL->operands))[1];
 	/* begin machineCodeAt:put: */
-	((self_in_concretizeCMPSMULL->machineCode))[0 / 4] = ((((((AL << 28) | ((0 << 25) | ((CmpOpcode << 21) | (1 << 20)))) | ((hiReg << 16) | (0 << 12))) + (0x1F << 7)) + (2 << 5)) + loReg);
+	aWord = (((((AL << 28) | ((0 << 25) | ((CmpOpcode << 21) | (1 << 20)))) | ((hiReg << 16) | (0 << 12))) + (0x1F << 7)) + (2 << 5)) + loReg;
+	((self_in_concretizeCMPSMULL->machineCode))[0 / 4] = aWord;
 	return ((self_in_concretizeCMPSMULL->machineCodeSize) = 4);
 }
 
@@ -3056,9 +2856,9 @@
 concretizeMSR(AbstractInstruction * self_in_concretizeMSR)
 {
     sqInt aWord;
-    sqInt flags;
+    unsigned long flags;
 
-	flags = concreteRegister(self_in_concretizeMSR, ((self_in_concretizeMSR->operands))[0]);
+	flags = ((self_in_concretizeMSR->operands))[0];
 	/* begin machineCodeAt:put: */
 	aWord = msr(self_in_concretizeMSR, flags);
 	((self_in_concretizeMSR->machineCode))[0 / 4] = aWord;
@@ -3072,18 +2872,20 @@
 static usqInt NoDbgRegParms
 concretizeSMULL(AbstractInstruction * self_in_concretizeSMULL)
 {
+    sqInt aWord;
     sqInt hiResultReg;
     sqInt loResultReg;
-    sqInt srcA;
-    sqInt srcB;
+    unsigned long srcA;
+    unsigned long srcB;
 
 
 	/* NOTE: srcB contains the other mutiplicand at this point. It is OK to use it as the destination for the low part of the result and in fact this saves us moving it later */
-	srcA = concreteRegister(self_in_concretizeSMULL, ((self_in_concretizeSMULL->operands))[0]);
-	loResultReg = (srcB = concreteRegister(self_in_concretizeSMULL, ((self_in_concretizeSMULL->operands))[1]));
-	hiResultReg = concreteRegister(self_in_concretizeSMULL, RISCTempReg);
+	srcA = ((self_in_concretizeSMULL->operands))[0];
+	loResultReg = (srcB = ((self_in_concretizeSMULL->operands))[1]);
+	hiResultReg = RISCTempReg;
 	/* begin machineCodeAt:put: */
-	((self_in_concretizeSMULL->machineCode))[0 / 4] = ((((((AL << 28) | ((0 << 25) | ((6 << 21) | (0 << 20)))) | ((hiResultReg << 16) | (loResultReg << 12))) + (srcA << 8)) + (9 << 4)) + srcB);
+	aWord = (((((AL << 28) | ((0 << 25) | ((6 << 21) | (0 << 20)))) | ((hiResultReg << 16) | (loResultReg << 12))) + (srcA << 8)) + (9 << 4)) + srcB;
+	((self_in_concretizeSMULL->machineCode))[0 / 4] = aWord;
 	return ((self_in_concretizeSMULL->machineCodeSize) = 4);
 }
 
@@ -3100,18 +2902,6 @@
 }
 
 
-/*	Answer the abstract register for the C result register.
-	Only partially implemented. Works on x86 since TempReg = EAX = C result
-	reg.  */
-
-	/* CogARMCompiler>>#cResultRegister */
-static sqInt NoDbgRegParms
-cResultRegister(AbstractInstruction * self_in_cResultRegister)
-{
-	return R0;
-}
-
-
 /*	return an {opcode} destReg, srcReg, addReg lsl #shft */
 /*	important detail - a 0 shft requires setting the shift-type code to 0 to
 	avoid potential instruction confusion
@@ -3229,15 +3019,28 @@
     sqInt aWord65;
     sqInt aWord66;
     sqInt aWord67;
+    sqInt aWord68;
+    sqInt aWord69;
     sqInt aWord7;
+    sqInt aWord70;
+    sqInt aWord71;
+    sqInt aWord72;
+    sqInt aWord73;
+    sqInt aWord74;
+    sqInt aWord75;
+    sqInt aWord76;
+    sqInt aWord77;
+    sqInt aWord78;
+    sqInt aWord79;
     sqInt aWord8;
+    sqInt aWord80;
     sqInt aWord9;
-    sqInt base;
-    sqInt base1;
-    sqInt base2;
-    sqInt base3;
-    sqInt baseReg;
-    sqInt baseReg1;
+    unsigned long base;
+    unsigned long base1;
+    unsigned long base2;
+    unsigned long base3;
+    unsigned long baseReg;
+    unsigned long baseReg1;
     usqInt constant;
     usqInt constant1;
     unsigned long constant10;
@@ -3254,31 +3057,31 @@
     unsigned long constant8;
     unsigned long constant9;
     AbstractInstruction *dependentChain;
-    sqInt dest;
-    sqInt dest1;
+    unsigned long dest;
+    unsigned long dest1;
     unsigned long destAddr;
     unsigned long destAddr1;
-    sqInt destReg;
-    sqInt destReg1;
-    sqInt destReg10;
-    sqInt destReg11;
-    sqInt destReg12;
-    sqInt destReg2;
-    sqInt destReg3;
-    sqInt destReg4;
-    sqInt destReg5;
-    sqInt destReg6;
-    sqInt destReg7;
-    sqInt destReg8;
-    sqInt destReg9;
+    unsigned long destReg;
+    unsigned long destReg1;
+    unsigned long destReg10;
+    unsigned long destReg11;
+    unsigned long destReg12;
+    unsigned long destReg2;
+    unsigned long destReg3;
+    unsigned long destReg4;
+    unsigned long destReg5;
+    unsigned long destReg6;
+    unsigned long destReg7;
+    unsigned long destReg8;
+    unsigned long destReg9;
     sqInt distance;
     sqInt distance1;
     sqInt distance2;
-    sqInt distReg;
-    sqInt distReg1;
-    sqInt distReg2;
-    sqInt dstReg;
-    sqInt dstReg1;
+    unsigned long distReg;
+    unsigned long distReg1;
+    unsigned long distReg2;
+    unsigned long dstReg;
+    unsigned long dstReg1;
     sqInt flagsOrOpcode;
     sqInt flagsOrOpcode1;
     sqInt flagsOrOpcode2;
@@ -3287,7 +3090,7 @@
     sqInt flagsOrOpcode5;
     sqInt flagsOrOpcode6;
     sqInt flagsOrOpcode7;
-    sqInt fpReg;
+    unsigned long fpReg;
     sqInt hb;
     sqInt hb1;
     sqInt hb2;
@@ -3332,39 +3135,39 @@
     sqInt immediate7;
     sqInt immediate8;
     sqInt immediate9;
-    sqInt index;
-    sqInt index1;
-    sqInt index2;
-    sqInt index3;
+    unsigned long index;
+    unsigned long index1;
+    unsigned long index2;
+    unsigned long index3;
     usqInt instrOffset;
-    sqInt instrOffset1;
-    sqInt instrOffset10;
-    sqInt instrOffset11;
-    sqInt instrOffset12;
-    sqInt instrOffset13;
-    sqInt instrOffset14;
-    sqInt instrOffset15;
-    sqInt instrOffset16;
-    sqInt instrOffset17;
-    sqInt instrOffset18;
+    usqInt instrOffset1;
+    usqInt instrOffset10;
+    usqInt instrOffset11;
+    usqInt instrOffset12;
+    usqInt instrOffset13;
+    usqInt instrOffset14;
+    usqInt instrOffset15;
+    usqInt instrOffset16;
+    usqInt instrOffset17;
+    usqInt instrOffset18;
     usqInt instrOffset19;
-    sqInt instrOffset2;
-    sqInt instrOffset20;
-    sqInt instrOffset21;
+    usqInt instrOffset2;
+    usqInt instrOffset20;
+    usqInt instrOffset21;
     usqInt instrOffset22;
     usqInt instrOffset23;
-    sqInt instrOffset24;
-    sqInt instrOffset25;
-    sqInt instrOffset26;
-    sqInt instrOffset27;
-    sqInt instrOffset28;
+    usqInt instrOffset24;
+    usqInt instrOffset25;
+    usqInt instrOffset26;
+    usqInt instrOffset27;
+    usqInt instrOffset28;
     usqInt instrOffset3;
-    sqInt instrOffset4;
+    usqInt instrOffset4;
     sqInt instrOffset5;
-    sqInt instrOffset6;
-    sqInt instrOffset7;
-    sqInt instrOffset8;
-    sqInt instrOffset9;
+    usqInt instrOffset6;
+    usqInt instrOffset7;
+    usqInt instrOffset8;
+    usqInt instrOffset9;
     sqInt invert;
     sqInt invert1;
     sqInt invert2;
@@ -3457,77 +3260,77 @@
     sqInt offset8;
     sqInt offset9;
     sqInt p;
-    sqInt rd;
-    sqInt rd1;
-    sqInt rd10;
-    sqInt rd11;
-    sqInt rd12;
-    sqInt rd13;
-    sqInt rd14;
-    sqInt rd15;
-    sqInt rd16;
-    sqInt rd17;
-    sqInt rd18;
-    sqInt rd19;
-    sqInt rd2;
-    sqInt rd20;
-    sqInt rd21;
-    sqInt rd22;
-    sqInt rd23;
-    sqInt rd24;
-    sqInt rd3;
-    sqInt rd4;
-    sqInt rd5;
-    sqInt rd6;
-    sqInt rd7;
-    sqInt rd8;
-    sqInt rd9;
-    sqInt reg;
-    sqInt reg1;
-    sqInt reg2;
-    sqInt reg3;
-    sqInt reg4;
-    sqInt reg5;
-    sqInt reg6;
-    sqInt reg7;
-    sqInt regA;
-    sqInt regB;
-    sqInt regLHS;
-    sqInt regLHS1;
-    sqInt regLHS2;
-    sqInt regLHS3;
-    sqInt regLHS4;
-    sqInt regRHS;
-    sqInt regRHS1;
-    sqInt regRHS2;
-    sqInt regRHS3;
-    sqInt rn;
-    sqInt rn1;
-    sqInt rn10;
-    sqInt rn11;
-    sqInt rn12;
-    sqInt rn13;
-    sqInt rn14;
-    sqInt rn15;
-    sqInt rn16;
-    sqInt rn17;
-    sqInt rn18;
-    sqInt rn19;
-    sqInt rn2;
-    sqInt rn20;
-    sqInt rn21;
-    sqInt rn22;
-    sqInt rn23;
-    sqInt rn24;
-    sqInt rn25;
-    sqInt rn26;
-    sqInt rn3;
-    sqInt rn4;
-    sqInt rn5;
-    sqInt rn6;
-    sqInt rn7;
-    sqInt rn8;
-    sqInt rn9;
+    unsigned long rd;
+    unsigned long rd1;
+    unsigned long rd10;
+    unsigned long rd11;
+    unsigned long rd12;
+    unsigned long rd13;
+    unsigned long rd14;
+    unsigned long rd15;
+    unsigned long rd16;
+    unsigned long rd17;
+    unsigned long rd18;
+    unsigned long rd19;
+    unsigned long rd2;
+    unsigned long rd20;
+    unsigned long rd21;
+    unsigned long rd22;
+    unsigned long rd23;
+    unsigned long rd24;
+    unsigned long rd3;
+    unsigned long rd4;
+    unsigned long rd5;
+    unsigned long rd6;
+    unsigned long rd7;
+    unsigned long rd8;
+    unsigned long rd9;
+    unsigned long reg;
+    unsigned long reg1;
+    unsigned long reg2;
+    unsigned long reg3;
+    unsigned long reg4;
+    unsigned long reg5;
+    unsigned long reg6;
+    unsigned long reg7;
+    unsigned long regA;
+    unsigned long regB;
+    unsigned long regLHS;
+    unsigned long regLHS1;
+    unsigned long regLHS2;
+    unsigned long regLHS3;
+    unsigned long regLHS4;
+    unsigned long regRHS;
+    unsigned long regRHS1;
+    unsigned long regRHS2;
+    unsigned long regRHS3;
+    unsigned long rn;
+    unsigned long rn1;
+    unsigned long rn10;
+    unsigned long rn11;
+    unsigned long rn12;
+    unsigned long rn13;
+    unsigned long rn14;
+    unsigned long rn15;
+    unsigned long rn16;
+    unsigned long rn17;
+    unsigned long rn18;
+    unsigned long rn19;
+    unsigned long rn2;
+    unsigned long rn20;
+    unsigned long rn21;
+    unsigned long rn22;
+    unsigned long rn23;
+    unsigned long rn24;
+    unsigned long rn25;
+    unsigned long rn26;
+    unsigned long rn3;
+    unsigned long rn4;
+    unsigned long rn5;
+    unsigned long rn6;
+    unsigned long rn7;
+    unsigned long rn8;
+    unsigned long rn9;
     sqInt rot;
     sqInt rot1;
     sqInt rot10;
@@ -3542,29 +3345,29 @@
     sqInt rot7;
     sqInt rot8;
     sqInt rot9;
-    sqInt src;
-    sqInt src1;
+    unsigned long src;
+    unsigned long src1;
     unsigned long srcAddr;
     unsigned long srcAddr1;
-    sqInt srcReg;
-    sqInt srcReg1;
-    sqInt srcReg10;
-    sqInt srcReg11;
-    sqInt srcReg12;
-    sqInt srcReg13;
-    sqInt srcReg14;
-    sqInt srcReg15;
-    sqInt srcReg16;
-    sqInt srcReg17;
-    sqInt srcReg18;
-    sqInt srcReg2;
-    sqInt srcReg3;
-    sqInt srcReg4;
-    sqInt srcReg5;
-    sqInt srcReg6;
-    sqInt srcReg7;
-    sqInt srcReg8;
-    sqInt srcReg9;
+    unsigned long srcReg;
+    unsigned long srcReg1;
+    unsigned long srcReg10;
+    unsigned long srcReg11;
+    unsigned long srcReg12;
+    unsigned long srcReg13;
+    unsigned long srcReg14;
+    unsigned long srcReg15;
+    unsigned long srcReg16;
+    unsigned long srcReg17;
+    unsigned long srcReg18;
+    unsigned long srcReg2;
+    unsigned long srcReg3;
+    unsigned long srcReg4;
+    unsigned long srcReg5;
+    unsigned long srcReg6;
+    unsigned long srcReg7;
+    unsigned long srcReg8;
+    unsigned long srcReg9;
     sqInt u;
     sqInt u1;
     sqInt u2;
@@ -3658,11 +3461,11 @@
 		assert(addressIsInCurrentCompilation((((self_in_dispatchConcretize->dependent))->address)));
 		assert((abs(((((self_in_dispatchConcretize->dependent))->address)) - (((self_in_dispatchConcretize->address)) + 8))) < (1 << 12));
 		/* begin machineCodeAt:put: */
-		aWord42 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8)
+		aWord43 = ldrrnplusimm(self_in_dispatchConcretize, ConcreteIPReg, PC, (((((self_in_dispatchConcretize->dependent))->address)) >= (((self_in_dispatchConcretize->address)) + 8)
 			? 1

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list