[Vm-dev] [commit][3374] CogVm source as per VMMaker.oscog-eem.1349

commits at squeakvm.org commits at squeakvm.org
Thu Jun 11 23:02:51 UTC 2015


Revision: 3374
Author:   eliot
Date:     2015-06-11 16:02:50 -0700 (Thu, 11 Jun 2015)
Log Message:
-----------
CogVm source as per VMMaker.oscog-eem.1349

Slang:
Modify prototype output so that non-static functions are declared as extern.
This to try and cure Cog crashes on compilers such as clang 3.4.

Spur:
Remember to count shrink requests

Cogit:
Changes for in-progress CogOutOfLineLiteralsARMCompiler code generator.

Move annotations into instructions, where they sit more naturally anyway.
But doing so makes it trivial to move annotations from the instructions
referencing out-of-line literals to the literals themselves.  Hence nuke
CogInstructionAnnotation.

Fix isAnInstruction for labels (methodLabel) and use it to guard
addressIsInCurrentCompilation: calls where a label is involved.

Move the assignment of maxSize out of computeMaximumSize and into
computeMaximumSizes for concision.

ARM Cogit:
Introduce some more abstractions for rotateable constants so that it is easier
to relate computeMaximumSize and dispatchConcetize in CogARMCompiler.  Provide
more opcode names and use them, and use inverseOpcodeFor: to calculate the
inverse opcode when the inverse constant is used.

Revise ARM getDefaultCogCodeSize given better estimates of relative code sizes.
Simplify isPICDependent to eliminate Calls, which are not pc-dependent (since
they always call out of the current compilaiton).

Fix bugs in computeMaximumSize with AddCqR and
SubCqR, and a bad slip in concretizePushCq.

Nuke the unused BICCqR opcode.  Add class vars to
name all the opcodes passed to concretizeDataOperationCwR:.

Make all the usages of flushICacheFrom:to: work with start-address to
byte-after-end-address. Irrelevant to x86, perfect for ARM, matches most of
the usage already in place.

Sista Cogit:
Added support for jumpOrPopIfNotInstanceOf: in cogit's scanner.

Unix: restore the SCCS revision after the version number in -version output.

Modified Paths:
--------------
    branches/Cog/nsspursrc/vm/cogit.h
    branches/Cog/nsspursrc/vm/cogitARMv5.c
    branches/Cog/nsspursrc/vm/cogitIA32.c
    branches/Cog/nsspursrc/vm/cointerp.c
    branches/Cog/nsspursrc/vm/cointerp.h
    branches/Cog/nsspursrc/vm/gcc3x-cointerp.c
    branches/Cog/nsspurstack64src/vm/gcc3x-interp.c
    branches/Cog/nsspurstack64src/vm/interp.c
    branches/Cog/nsspurstacksrc/vm/gcc3x-interp.c
    branches/Cog/nsspurstacksrc/vm/interp.c
    branches/Cog/platforms/unix/vm/sqUnixMain.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

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

Modified: branches/Cog/nsspursrc/vm/cogit.h
===================================================================
--- branches/Cog/nsspursrc/vm/cogit.h	2015-06-06 17:07:13 UTC (rev 3373)
+++ branches/Cog/nsspursrc/vm/cogit.h	2015-06-11 23:02:50 UTC (rev 3374)
@@ -1,5 +1,5 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1339 uuid: 022ddfcc-a8f6-422b-8a81-edffae18ebe6
+	CCodeGenerator VMMaker.oscog-eem.1349 uuid: c4bacc64-8f85-425f-b5b9-47504c99cabe
  */
 
 
@@ -20,77 +20,77 @@
 # define NeverInline /*empty*/
 #endif
 
-sqInt abortOffset(void);
-void addCogMethodsToHeapMap(void);
-sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
-void callCogCodePopReceiver(void);
-void callCogCodePopReceiverAndClassRegs(void);
-sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver);
-sqInt ceSICMiss(sqInt receiver);
-void checkAssertsEnabledInCogit(void);
-sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes);
-char * codeEntryFor(char *address);
-char * codeEntryNameFor(char *address);
-sqInt cogCodeBase(void);
-sqInt cogCodeConstituents(void);
-void cogitPostGCAction(sqInt gcMode);
-sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod);
-CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs);
-CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop);
-void compactCogCompiledCode(void);
-sqInt defaultCogCodeSize(void);
-void enterCogCodePopReceiver(void);
-CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod);
-void followForwardedLiteralsIn(CogMethod *cogMethod);
-void followForwardedMethods(void);
-void freeUnmarkedMachineCode(void);
-void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
-sqInt isPCWithinMethodZone(void *address);
-sqInt isSendReturnPC(sqInt retpc);
-void linkNSSendCacheclassTagenclosingObjecttargetcaller(NSSendCache *nsSendCache, sqInt classTag, sqInt enclosingObject, CogMethod *targetMethod, CogMethod *callingMethod);
-void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver);
-void mapObjectReferencesInMachineCode(sqInt gcMode);
-void markAndTraceMachineCodeOfMarkedMethods(void);
-void markMethodAndReferents(CogBlockMethod *aCogMethod);
-usqInt maxCogMethodAddress(void);
-usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
-sqInt minCogMethodAddress(void);
-sqInt mnuOffset(void);
-sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
-sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
-void printCogMethodFor(void *address);
-void printTrampolineTable(void);
-sqInt recordPrimTraceFunc(void);
-void setBreakMethod(sqInt anObj);
-void setPostCompileHook(void (*aFunction)(CogMethod *, void *));
-void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop);
-sqInt traceLinkedSendOffset(void);
-void unlinkAllSends(void);
-void unlinkSendsLinkedForInvalidClasses(void);
-void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector);
-void unlinkSendsToFree(void);
-void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue);
-void addAllToYoungReferrers(void);
-void freeMethod(CogMethod *cogMethod);
-CogMethod * methodFor(void *address);
-sqInt numMethodsOfType(sqInt cogMethodType);
-void printCogMethods(void);
-void printCogMethodsOfType(sqInt cmType);
-void printCogMethodsWithMethod(sqInt methodOop);
-void printCogMethodsWithPrimitive(sqInt primIdx);
-void printCogMethodsWithSelector(sqInt selectorOop);
-void printCogYoungReferrers(void);
-void printOpenPICList(void);
-char * whereIsMaybeCodeThing(sqInt anOop);
-sqInt numRegArgs(void);
-sqInt genQuickReturnConst(void);
-sqInt genQuickReturnInstVar(void);
-sqInt genQuickReturnSelf(void);
-void recordCallOffsetInof(CogMethod *cogMethod, void *callLabelArg);
-void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void));
-void voidCogCompiledCode(void);
-void callCogCodePopReceiverArg0Regs(void);
-void callCogCodePopReceiverArg1Arg0Regs(void);
+extern sqInt abortOffset(void);
+extern void addCogMethodsToHeapMap(void);
+extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
+extern void callCogCodePopReceiver(void);
+extern void callCogCodePopReceiverAndClassRegs(void);
+extern sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver);
+extern sqInt ceSICMiss(sqInt receiver);
+extern void checkAssertsEnabledInCogit(void);
+extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes);
+extern char * codeEntryFor(char *address);
+extern char * codeEntryNameFor(char *address);
+extern sqInt cogCodeBase(void);
+extern sqInt cogCodeConstituents(void);
+extern void cogitPostGCAction(sqInt gcMode);
+extern sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod);
+extern CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs);
+extern CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop);
+extern void compactCogCompiledCode(void);
+extern sqInt defaultCogCodeSize(void);
+extern void enterCogCodePopReceiver(void);
+extern CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod);
+extern void followForwardedLiteralsIn(CogMethod *cogMethod);
+extern void followForwardedMethods(void);
+extern void freeUnmarkedMachineCode(void);
+extern void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
+extern sqInt isPCWithinMethodZone(void *address);
+extern sqInt isSendReturnPC(sqInt retpc);
+extern void linkNSSendCacheclassTagenclosingObjecttargetcaller(NSSendCache *nsSendCache, sqInt classTag, sqInt enclosingObject, CogMethod *targetMethod, CogMethod *callingMethod);
+extern void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver);
+extern void mapObjectReferencesInMachineCode(sqInt gcMode);
+extern void markAndTraceMachineCodeOfMarkedMethods(void);
+extern void markMethodAndReferents(CogBlockMethod *aCogMethod);
+extern usqInt maxCogMethodAddress(void);
+extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
+extern sqInt minCogMethodAddress(void);
+extern sqInt mnuOffset(void);
+extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
+extern sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
+extern void printCogMethodFor(void *address);
+extern void printTrampolineTable(void);
+extern sqInt recordPrimTraceFunc(void);
+extern void setBreakMethod(sqInt anObj);
+extern void setPostCompileHook(void (*aFunction)(CogMethod *, void *));
+extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop);
+extern sqInt traceLinkedSendOffset(void);
+extern void unlinkAllSends(void);
+extern void unlinkSendsLinkedForInvalidClasses(void);
+extern void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector);
+extern void unlinkSendsToFree(void);
+extern void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue);
+extern void addAllToYoungReferrers(void);
+extern void freeMethod(CogMethod *cogMethod);
+extern CogMethod * methodFor(void *address);
+extern sqInt numMethodsOfType(sqInt cogMethodType);
+extern void printCogMethods(void);
+extern void printCogMethodsOfType(sqInt cmType);
+extern void printCogMethodsWithMethod(sqInt methodOop);
+extern void printCogMethodsWithPrimitive(sqInt primIdx);
+extern void printCogMethodsWithSelector(sqInt selectorOop);
+extern void printCogYoungReferrers(void);
+extern void printOpenPICList(void);
+extern char * whereIsMaybeCodeThing(sqInt anOop);
+extern sqInt numRegArgs(void);
+extern sqInt genQuickReturnConst(void);
+extern sqInt genQuickReturnInstVar(void);
+extern sqInt genQuickReturnSelf(void);
+extern void recordCallOffsetInof(CogMethod *cogMethod, void *callLabelArg);
+extern void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void));
+extern void voidCogCompiledCode(void);
+extern void callCogCodePopReceiverArg0Regs(void);
+extern void callCogCodePopReceiverArg1Arg0Regs(void);
 
 
 /*** Global Variables ***/

Modified: branches/Cog/nsspursrc/vm/cogitARMv5.c
===================================================================
--- branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-06 17:07:13 UTC (rev 3373)
+++ branches/Cog/nsspursrc/vm/cogitARMv5.c	2015-06-11 23:02:50 UTC (rev 3374)
@@ -1,9 +1,9 @@
 /* Automatically generated by
-	CCodeGenerator VMMaker.oscog-eem.1339 uuid: 022ddfcc-a8f6-422b-8a81-edffae18ebe6
+	CCodeGenerator VMMaker.oscog-eem.1349 uuid: c4bacc64-8f85-425f-b5b9-47504c99cabe
    from
-	StackToRegisterMappingCogit VMMaker.oscog-eem.1339 uuid: 022ddfcc-a8f6-422b-8a81-edffae18ebe6
+	StackToRegisterMappingCogit VMMaker.oscog-eem.1349 uuid: c4bacc64-8f85-425f-b5b9-47504c99cabe
  */
-static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1339 uuid: 022ddfcc-a8f6-422b-8a81-edffae18ebe6 " __DATE__ ;
+static char __buildInfo[] = "StackToRegisterMappingCogit VMMaker.oscog-eem.1349 uuid: c4bacc64-8f85-425f-b5b9-47504c99cabe " __DATE__ ;
 char *__cogitBuildInfo = __buildInfo;
 
 
@@ -25,6 +25,7 @@
 	unsigned char	opcode;
 	unsigned char	machineCodeSize;
 	unsigned char	maxSize;
+	unsigned char	annotation;
 	unsigned char	conditionOrNil;
 	unsigned long		operands [3];
 	unsigned long	address;
@@ -73,14 +74,6 @@
 
 
 typedef struct {
-	sqInt	annotation;
-	AbstractInstruction *instruction;
- } InstructionAnnotation;
-
-#define CogInstructionAnnotation InstructionAnnotation
-
-
-typedef struct {
 	sqInt (*primitiveGenerator )(void);
 	sqInt	primNumArgs;
 	sqInt (*enabled )(sqInt);
@@ -117,27 +110,26 @@
 
 
 /*** Constants ***/
-#define AddCqR 95
-#define AddCwR 102
+#define AddCqR 96
+#define AddCwR 104
 #define AddOpcode 4
-#define AddRdRd 110
-#define AddRR 88
+#define AddRdRd 112
+#define AddRR 89
 #define AL 14
-#define AlignmentNops 2
+#define AlignmentNops 3
 #define AltBlockCreationBytecodeSize 3
 #define AltFirstSpecialSelector 80
-#define AndCqR 97
-#define AndCqRR 108
-#define AndCwR 104
+#define AndCqR 98
+#define AndCqRR 110
+#define AndCwR 106
 #define AndOpcode 0
-#define AndRR 90
+#define AndRR 91
 #define AnnotationShift 5
 #define Arg0Reg -7
 #define Arg1Reg -8
-#define ArithmeticShiftRightCqR 81
-#define ArithmeticShiftRightRR 82
+#define ArithmeticShiftRightCqR 82
+#define ArithmeticShiftRightRR 83
 #define BadRegisterSet 1
-#define BICCqR 122
 #define BicOpcode 14
 #define BlockCreationBytecodeSize 4
 #define BytecodeSetHasDirectedSuperSend 0
@@ -145,8 +137,8 @@
 #define CArg1Reg 1
 #define CArg2Reg 2
 #define CArg3Reg 3
-#define Call 9
-#define CallFull 10
+#define Call 10
+#define CallFull 11
 #define CC 3
 #define ClassArrayCompactIndex 51
 #define ClassBlockClosureCompactIndex 37
@@ -165,31 +157,32 @@
 #define CMMethod 2
 #define CMOpenPIC 5
 #define CMPSMULL 123
-#define CmpCqR 94
-#define CmpCwR 101
+#define CmpCqR 95
+#define CmpCwR 103
+#define CmpNotOpcode 11
 #define CmpOpcode 10
-#define CmpRdRd 109
-#define CmpRR 87
+#define CmpRdRd 111
+#define CmpRR 88
 #define ConcreteIPReg 12
 #define ConcreteVarBaseReg 10
 #define ConstZero 1
-#define ConvertRRd 116
+#define ConvertRRd 117
 #define CS 2
 #define Debug DEBUGVM
 #define DisplacementMask 0x1F
 #define DisplacementX2N 0
-#define DivRdRd 113
+#define DivRdRd 115
 #define DPFPReg0 -9
 #define DPFPReg1 -10
 #define DPFPReg2 -11
 #define EncounteredUnknownBytecode -6
 #define EQ 0
-#define Fill16 5
-#define Fill32 6
-#define FillFromWord 7
+#define Fill16 6
+#define Fill32 7
+#define FillFromWord 8
 #define FirstAnnotation 64
-#define FirstJump 14
-#define FirstShortJump 18
+#define FirstJump 15
+#define FirstShortJump 19
 #define FirstSpecialSelector 176
 #define FoxCallerSavedIP 4
 #define FoxMethod -4
@@ -221,46 +214,47 @@
 #define IsRelativeCall 5
 #define IsSendCall 7
 #define IsSuperSend 8
-#define Jump 18
-#define JumpAbove 33
-#define JumpAboveOrEqual 32
-#define JumpBelow 31
-#define JumpBelowOrEqual 34
-#define JumpCarry 25
-#define JumpFPEqual 35
-#define JumpFPGreater 39
-#define JumpFPGreaterOrEqual 40
-#define JumpFPLess 37
-#define JumpFPLessOrEqual 38
-#define JumpFPNotEqual 36
-#define JumpFPOrdered 41
-#define JumpFPUnordered 42
-#define JumpFull 14
-#define JumpGreater 29
-#define JumpGreaterOrEqual 28
-#define JumpLess 27
-#define JumpLessOrEqual 30
-#define JumpLong 15
-#define JumpLongNonZero 17
-#define JumpLongZero 16
-#define JumpNegative 21
-#define JumpNoCarry 26
-#define JumpNonNegative 22
-#define JumpNonZero 20
-#define JumpNoOverflow 24
-#define JumpOverflow 23
-#define JumpR 12
-#define JumpZero 19
+#define Jump 19
+#define JumpAbove 34
+#define JumpAboveOrEqual 33
+#define JumpBelow 32
+#define JumpBelowOrEqual 35
+#define JumpCarry 26
+#define JumpFPEqual 36
+#define JumpFPGreater 40
+#define JumpFPGreaterOrEqual 41
+#define JumpFPLess 38
+#define JumpFPLessOrEqual 39
+#define JumpFPNotEqual 37
+#define JumpFPOrdered 42
+#define JumpFPUnordered 43
+#define JumpFull 15
+#define JumpGreater 30
+#define JumpGreaterOrEqual 29
+#define JumpLess 28
+#define JumpLessOrEqual 31
+#define JumpLong 16
+#define JumpLongNonZero 18
+#define JumpLongZero 17
+#define JumpNegative 22
+#define JumpNoCarry 27
+#define JumpNonNegative 23
+#define JumpNonZero 21
+#define JumpNoOverflow 25
+#define JumpOverflow 24
+#define JumpR 13
+#define JumpZero 20
 #define Label 1
 #define LargeContextSlots 62
-#define LastJump 42
+#define LastJump 43
 #define LE 13
 #define LinkReg -17
-#define LoadEffectiveAddressMwrR 78
-#define LogicalShiftLeftCqR 85
-#define LogicalShiftLeftRR 86
-#define LogicalShiftRightCqR 83
-#define LogicalShiftRightRR 84
+#define Literal 2
+#define LoadEffectiveAddressMwrR 79
+#define LogicalShiftLeftCqR 86
+#define LogicalShiftLeftRR 87
+#define LogicalShiftRightCqR 84
+#define LogicalShiftRightRR 85
 #define LR 14
 #define LS 9
 #define LT 11
@@ -281,32 +275,32 @@
 #define MFMethodFlagHasContextFlag 1
 #define MFMethodFlagIsBlockFlag 2
 #define MI 4
-#define MoveAwR 44
-#define MoveCqR 66
-#define MoveCwR 67
-#define MoveM16rR 54
-#define MoveM64rRd 71
-#define MoveMbrR 62
-#define MoveMwrR 48
+#define MoveAwR 45
+#define MoveCqR 67
+#define MoveCwR 68
+#define MoveM16rR 55
+#define MoveM64rRd 72
+#define MoveMbrR 63
+#define MoveMwrR 49
 #define MoveNotOpcode 15
 #define MoveOpcode 13
-#define MoveRAw 45
-#define MoveRdM64r 72
-#define MoveRdRd 70
-#define MoveRMbr 63
-#define MoveRMwr 49
-#define MoveRR 43
-#define MoveRXbrR 65
-#define MoveRXwrR 51
-#define MoveXbrRR 64
-#define MoveXwrRR 50
-#define MSR 118
+#define MoveRAw 46
+#define MoveRdM64r 73
+#define MoveRdRd 71
+#define MoveRMbr 64
+#define MoveRMwr 50
+#define MoveRR 44
+#define MoveRXbrR 66
+#define MoveRXwrR 52
+#define MoveXbrRR 65
+#define MoveXwrRR 51
+#define MSR 119
 #define MULTIPLEBYTECODESETS 1
-#define MulRdRd 112
+#define MulRdRd 114
 #define NE 1
-#define NegateR 80
+#define NegateR 81
 #define NewspeakVM 1
-#define Nop 8
+#define Nop 9
 #define NotFullyInitialized -1
 #define NSCClassTagIndex 0
 #define NSCEnclosingObjectIndex 1
@@ -316,24 +310,24 @@
 #define NumOopsPerNSC 6
 #define NumSendTrampolines 4
 #define NumTrampolines 72
-#define OrCqR 98
-#define OrCwR 105
+#define OrCqR 99
+#define OrCwR 107
 #define OrOpcode 12
-#define OrRR 91
+#define OrRR 92
 #define PC 15
 #define PCReg -19
 #define PL 5
-#define PopR 73
-#define PrefetchAw 77
+#define PopR 74
+#define PrefetchAw 78
 #define PrimCallCollectsProfileSamples 8
 #define PrimCallDoNotJIT 32
 #define PrimCallMayCallBack 4
 #define PrimCallNeedsNewMethod 1
 #define PrimCallNeedsPrimitiveFunction 2
 #define PrimErrWritePastObject 17
-#define PushCq 75
-#define PushCw 76
-#define PushR 74
+#define PushCq 76
+#define PushCw 77
+#define PushR 75
 #define R0 0
 #define R11 11
 #define R4 4
@@ -343,7 +337,7 @@
 #define R8 8
 #define ReceiverIndex 5
 #define ReceiverResultReg -3
-#define RetN 11
+#define RetN 12
 #define RISCTempReg -18
 #define RsbOpcode 3
 #define SelectorCannotInterpret 34
@@ -352,34 +346,35 @@
 #define SendNumArgsReg -6
 #define ShouldNotJIT -8
 #define SistaVM 0
-#define SMULL 117
+#define SMULL 118
 #define SmallContextSlots 22
 #define SP 13
 #define SPReg -2
-#define SqrtRd 115
+#define SqrtRd 116
 #define SSBaseOffset 1
 #define SSConstant 2
 #define SSRegister 3
 #define SSSpill 4
 #define StackPointerIndex 2
-#define Stop 13
-#define SubCqR 96
-#define SubCwR 103
+#define Stop 14
+#define SubCqR 97
+#define SubCwR 105
 #define SubOpcode 2
-#define SubRdRd 111
-#define SubRR 89
+#define SubRdRd 113
+#define SubRR 90
 #define TempReg -4
-#define TstCqR 114
+#define TstCqR 100
+#define TstOpcode 8
 #define UnfailingPrimitive 3
 #define UnimplementedPrimitive -7
 #define ValueIndex 1
 #define VarBaseReg -20
 #define VC 7
 #define VS 6
-#define XorCqR 99
-#define XorCwR 106
+#define XorCqR 101
+#define XorCwR 108
 #define XorOpcode 1
-#define XorRR 92
+#define XorRR 93
 #define YoungSelectorInPIC -5
 
 
@@ -426,7 +421,6 @@
 static sqInt bl(AbstractInstruction * self_in_bl, sqInt offset) NoDbgRegParms;
 static sqInt b(AbstractInstruction * self_in_b, sqInt offset) NoDbgRegParms;
 static sqInt callerSavedRegisterMask(AbstractInstruction * self_in_callerSavedRegisterMask) NoDbgRegParms;
-static sqInt callFullTargetFromReturnAddress(AbstractInstruction * self_in_callFullTargetFromReturnAddress, sqInt callSiteReturnAddress) NoDbgRegParms;
 static sqInt callInstructionByteSize(AbstractInstruction * self_in_callInstructionByteSize) NoDbgRegParms;
 static sqInt callTargetFromReturnAddress(AbstractInstruction * self_in_callTargetFromReturnAddress, sqInt callSiteReturnAddress) NoDbgRegParms;
 static sqInt computeMaximumSize(AbstractInstruction * self_in_computeMaximumSize) NoDbgRegParms;
@@ -453,7 +447,6 @@
 static sqInt cResultRegister(AbstractInstruction * self_in_cResultRegister) NoDbgRegParms;
 static sqInt dataOpTyperdrnrmlsr(AbstractInstruction * self_in_dataOpTyperdrnrmlsr, sqInt armOpcode, sqInt destReg, sqInt srcReg, sqInt addReg, sqInt shft) NoDbgRegParms;
 static void dispatchConcretize(AbstractInstruction * self_in_dispatchConcretize) NoDbgRegParms;
-static sqInt extract32BitOperandFrom4InstructionsPreceeding(AbstractInstruction * self_in_extract32BitOperandFrom4InstructionsPreceeding, sqInt addr) NoDbgRegParms;
 static sqInt fullCallsAreRelative(AbstractInstruction * self_in_fullCallsAreRelative) NoDbgRegParms;
 static sqInt genAlignCStackSavingRegistersnumArgswordAlignment(AbstractInstruction * self_in_genAlignCStackSavingRegistersnumArgswordAlignment, sqInt saveRegs, sqInt numArgs, sqInt alignment) NoDbgRegParms;
 static AbstractInstruction * genDivRRQuoRem(AbstractInstruction * self_in_genDivRRQuoRem, sqInt abstractRegDivisor, sqInt abstractRegDividend, sqInt abstractRegQuotient, sqInt abstractRegRemainder) NoDbgRegParms;
@@ -475,8 +468,6 @@
 static sqInt hasLinkRegister(AbstractInstruction * self_in_hasLinkRegister) NoDbgRegParms;
 static sqInt hasPCDependentInstruction(AbstractInstruction * self_in_hasPCDependentInstruction) NoDbgRegParms;
 static sqInt hasPCRegister(AbstractInstruction * self_in_hasPCRegister) NoDbgRegParms;
-static sqInt inlineCacheTagAt(AbstractInstruction * self_in_inlineCacheTagAt, sqInt callSiteReturnAddress) NoDbgRegParms;
-static sqInt instructionBeforeAddress(AbstractInstruction * self_in_instructionBeforeAddress, sqInt followingAddress) NoDbgRegParms;
 static sqInt instructionIsBLX(AbstractInstruction * self_in_instructionIsBLX, sqInt instr) NoDbgRegParms;
 static sqInt instructionIsBL(AbstractInstruction * self_in_instructionIsBL, sqInt instr) NoDbgRegParms;
 static sqInt instructionIsBX(AbstractInstruction * self_in_instructionIsBX, sqInt instr) NoDbgRegParms;
@@ -484,11 +475,11 @@
 static sqInt instructionIsOR(AbstractInstruction * self_in_instructionIsOR, sqInt instr) NoDbgRegParms;
 static sqInt instructionIsPush(AbstractInstruction * self_in_instructionIsPush, sqInt instr) NoDbgRegParms;
 static sqInt instructionSizeAt(AbstractInstruction * self_in_instructionSizeAt, sqInt pc) NoDbgRegParms;
+static sqInt inverseOpcodeFor(AbstractInstruction * self_in_inverseOpcodeFor, sqInt armOpcode) NoDbgRegParms;
 static sqInt isAddressRelativeToVarBase(AbstractInstruction * self_in_isAddressRelativeToVarBase, usqInt varAddress) NoDbgRegParms;
 static sqInt isCallPreceedingReturnPC(AbstractInstruction * self_in_isCallPreceedingReturnPC, sqInt mcpc) NoDbgRegParms;
 static sqInt isInImmediateJumpRange(AbstractInstruction * self_in_isInImmediateJumpRange, unsigned long operand) NoDbgRegParms;
 static sqInt isJumpAt(AbstractInstruction * self_in_isJumpAt, sqInt pc) NoDbgRegParms;
-static sqInt isPCDependent(AbstractInstruction * self_in_isPCDependent) NoDbgRegParms;
 static sqInt isPCRelativeValueLoad(AbstractInstruction * self_in_isPCRelativeValueLoad, unsigned int instr) NoDbgRegParms;
 static sqInt jumpLongByteSize(AbstractInstruction * self_in_jumpLongByteSize) NoDbgRegParms;
 static sqInt jumpLongConditionalByteSize(AbstractInstruction * self_in_jumpLongConditionalByteSize) NoDbgRegParms;
@@ -502,7 +493,6 @@
 static sqInt ldrrnplusimm(AbstractInstruction * self_in_ldrrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue) NoDbgRegParms;
 static sqInt ldrrnrm(AbstractInstruction * self_in_ldrrnrm, sqInt destReg, sqInt baseReg, sqInt offsetReg) NoDbgRegParms;
 static sqInt leafCallStackPointerDelta(AbstractInstruction * self_in_leafCallStackPointerDelta) NoDbgRegParms;
-static sqInt literalBeforeFollowingAddress(AbstractInstruction * self_in_literalBeforeFollowingAddress, sqInt followingAddress) NoDbgRegParms;
 static sqInt loadCwInto(AbstractInstruction * self_in_loadCwInto, sqInt destReg) NoDbgRegParms;
 static sqInt loadLiteralByteSize(AbstractInstruction * self_in_loadLiteralByteSize) NoDbgRegParms;
 static sqInt loadPICLiteralByteSize(AbstractInstruction * self_in_loadPICLiteralByteSize) NoDbgRegParms;
@@ -528,18 +518,12 @@
 static sqInt pushLinkRegisterByteSize(AbstractInstruction * self_in_pushLinkRegisterByteSize) NoDbgRegParms;
 static sqInt pushR(AbstractInstruction * self_in_pushR, sqInt srcReg) NoDbgRegParms;
 static AbstractInstruction * relocateCallBeforeReturnPCby(AbstractInstruction * self_in_relocateCallBeforeReturnPCby, sqInt retpc, sqInt delta) NoDbgRegParms;
-static AbstractInstruction * relocateMethodReferenceBeforeAddressby(AbstractInstruction * self_in_relocateMethodReferenceBeforeAddressby, sqInt pc, sqInt delta) NoDbgRegParms;
 static sqInt rewriteCallAttarget(AbstractInstruction * self_in_rewriteCallAttarget, usqInt callSiteReturnAddress, usqInt callTargetAddress) NoDbgRegParms;
 static sqInt rewriteCallFullAttarget(AbstractInstruction * self_in_rewriteCallFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) NoDbgRegParms;
-static sqInt rewriteFullTransferAttargetexpectedInstruction(AbstractInstruction * self_in_rewriteFullTransferAttargetexpectedInstruction, usqInt callSiteReturnAddress, usqInt callTargetAddress, sqInt expectedInstruction) NoDbgRegParms;
-static sqInt rewriteInlineCacheAttagtarget(AbstractInstruction * self_in_rewriteInlineCacheAttagtarget, usqInt callSiteReturnAddress, sqInt cacheTag, usqInt callTargetAddress) NoDbgRegParms;
-static AbstractInstruction * rewriteInlineCacheTagat(AbstractInstruction * self_in_rewriteInlineCacheTagat, sqInt cacheTag, sqInt callSiteReturnAddress) NoDbgRegParms;
 static sqInt rewriteJumpFullAttarget(AbstractInstruction * self_in_rewriteJumpFullAttarget, sqInt callSiteReturnAddress, sqInt callTargetAddress) NoDbgRegParms;
 static sqInt setsConditionCodesFor(AbstractInstruction * self_in_setsConditionCodesFor, sqInt aConditionalJumpOpcode) NoDbgRegParms;
 static sqInt shiftSetsConditionCodesFor(AbstractInstruction * self_in_shiftSetsConditionCodesFor, sqInt aConditionalJumpOpcode) NoDbgRegParms;
-static usqInt sizePCDependentInstructionAt(AbstractInstruction * self_in_sizePCDependentInstructionAt, sqInt eventualAbsoluteAddress) NoDbgRegParms;
 static sqInt stackPageInterruptHeadroomBytes(AbstractInstruction * self_in_stackPageInterruptHeadroomBytes) NoDbgRegParms;
-static AbstractInstruction * storeLiteralbeforeFollowingAddress(AbstractInstruction * self_in_storeLiteralbeforeFollowingAddress, sqInt literal, sqInt followingAddress) NoDbgRegParms;
 static sqInt strbrnplusimm(AbstractInstruction * self_in_strbrnplusimm, sqInt destReg, sqInt baseReg, sqInt u, sqInt immediate12bitValue) NoDbgRegParms;
 static sqInt strbrnrm(AbstractInstruction * self_in_strbrnrm, sqInt srcReg, sqInt baseReg, sqInt offsetReg) NoDbgRegParms;
 static sqInt strrnplusImm(AbstractInstruction * self_in_strrnplusImm, sqInt srcReg, sqInt baseReg, sqInt immediate12bitValue) NoDbgRegParms;
@@ -550,11 +534,12 @@
 static sqInt tstrnimmror(AbstractInstruction * self_in_tstrnimmror, sqInt ignored, sqInt srcReg, sqInt immediate, sqInt rot) NoDbgRegParms;
 static CogMethod * cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod) NoDbgRegParms;
 static sqInt isBranch(BytecodeDescriptor * self_in_isBranch) NoDbgRegParms;
+static sqInt isUnconditionalBranch(BytecodeDescriptor * self_in_isUnconditionalBranch) NoDbgRegParms;
 static AbstractInstruction * gAndCqR(sqInt quickConstant, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gArithmeticShiftRightRR(sqInt reg1, sqInt reg2) NoDbgRegParms;
-sqInt abortOffset(void);
+extern sqInt abortOffset(void);
 static void addCleanBlockStarts(void);
-void addCogMethodsToHeapMap(void);
+extern void addCogMethodsToHeapMap(void);
 static sqInt addressIsInCurrentCompilation(sqInt address) NoDbgRegParms;
 static sqInt addressIsInFixups(AbstractInstruction *address) NoDbgRegParms;
 static sqInt addressIsInInstructions(AbstractInstruction *address) NoDbgRegParms;
@@ -565,41 +550,40 @@
 static AbstractInstruction * annotateAbsolutePCRef(AbstractInstruction *abstractInstruction) NoDbgRegParms;
 static AbstractInstruction * annotateBytecode(AbstractInstruction *abstractInstruction) NoDbgRegParms;
 static AbstractInstruction * annotateobjRef(AbstractInstruction *abstractInstruction, sqInt anOop) NoDbgRegParms;
-static AbstractInstruction * annotatewith(AbstractInstruction *abstractInstruction, sqInt annotationFlag) NoDbgRegParms;
 static sqInt annotationForMcpcin(sqInt mcpc, CogMethod *cogHomeMethod) NoDbgRegParms;
 static void assertSaneJumpTarget(AbstractInstruction *jumpTarget) NoDbgRegParms;
 static sqInt blockCreationBytecodeSizeForHeader(sqInt methodHeader) NoDbgRegParms;
 static sqInt blockDispatchTargetsForperformarg(CogMethod *cogMethod, usqInt (*binaryFunction)(sqInt mcpc, sqInt arg), sqInt arg) NoDbgRegParms;
-sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
+extern sqInt bytecodePCForstartBcpcin(sqInt mcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
 static AbstractInstruction * CallNewspeakSend(sqInt callTarget) NoDbgRegParms;
 static AbstractInstruction * CallRTregistersToBeSavedMask(sqInt callTarget, sqInt registersToBeSaved) NoDbgRegParms;
 static AbstractInstruction * gCall(sqInt callTarget) NoDbgRegParms;
 static AbstractInstruction * gCmpCqR(sqInt quickConstant, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gCmpCwR(sqInt wordConstant, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gCmpRR(sqInt reg1, sqInt reg2) NoDbgRegParms;
-void callCogCodePopReceiver(void);
-void callCogCodePopReceiverAndClassRegs(void);
-sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver);
-sqInt ceSICMiss(sqInt receiver);
-void checkAssertsEnabledInCogit(void);
+extern void callCogCodePopReceiver(void);
+extern void callCogCodePopReceiverAndClassRegs(void);
+extern sqInt ceCPICMissreceiver(CogMethod *cPIC, sqInt receiver);
+extern sqInt ceSICMiss(sqInt receiver);
+extern void checkAssertsEnabledInCogit(void);
 static sqInt checkIfValidOopRefAndTargetpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
 static sqInt checkIfValidOopRefpccogMethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
-sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes);
+extern sqInt checkIntegrityOfObjectReferencesInCode(sqInt gcModes);
 static sqInt checkMaybeObjRefAt(sqInt mcpc) NoDbgRegParms;
 static sqInt checkValidObjectReferencesInClosedPIC(CogMethod *cPIC) NoDbgRegParms;
 static sqInt closedPICRefersToUnmarkedObject(CogMethod *cPIC) NoDbgRegParms;
-char * codeEntryFor(char *address);
-char * codeEntryNameFor(char *address);
-sqInt cogCodeBase(void);
-sqInt cogCodeConstituents(void);
+extern char * codeEntryFor(char *address);
+extern char * codeEntryNameFor(char *address);
+extern sqInt cogCodeBase(void);
+extern sqInt cogCodeConstituents(void);
 static sqInt cogExtendPICCaseNMethodtagisMNUCase(CogMethod *cPIC, sqInt caseNMethod, sqInt caseNTag, sqInt isMNUCase) NoDbgRegParms;
-void cogitPostGCAction(sqInt gcMode);
-sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod);
-CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs);
+extern void cogitPostGCAction(sqInt gcMode);
+extern sqInt cogMethodDoesntLookKosher(CogMethod *cogMethod);
+extern CogMethod * cogMNUPICSelectorreceivermethodOperandnumArgs(sqInt selector, sqInt rcvr, sqInt methodOperand, sqInt numArgs);
 static CogMethod * cogOpenPICSelectornumArgs(sqInt selector, sqInt numArgs) NoDbgRegParms;
 static CogMethod * cogPICSelectornumArgsCase0MethodCase1MethodtagisMNUCase(sqInt selector, sqInt numArgs, CogMethod *case0CogMethod, sqInt case1MethodOrNil, sqInt case1Tag, sqInt isMNUCase) NoDbgRegParms;
-CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop);
-void compactCogCompiledCode(void);
+extern CogMethod * cogselector(sqInt aMethodObj, sqInt aSelectorOop);
+extern void compactCogCompiledCode(void);
 static AbstractInstruction * compileAbort(void);
 static sqInt compileBlockDispatchFromto(sqInt lowBlockStartIndex, sqInt highBlockStartIndex) NoDbgRegParms;
 static void compileBlockEntry(BlockStart *blockStart) NoDbgRegParms;
@@ -618,23 +602,23 @@
 static sqInt cPICHasFreedTargets(CogMethod *cPIC) NoDbgRegParms;
 static sqInt cPICHasTarget(CogMethod *cPIC, CogMethod *targetMethod) NoDbgRegParms;
 static AbstractInstruction * gDivRRQuoRem(sqInt rDivisor, sqInt rDividend, sqInt rQuotient, sqInt rRemainder) NoDbgRegParms;
-sqInt defaultCogCodeSize(void);
+extern sqInt defaultCogCodeSize(void);
 static sqInt endPCOf(sqInt aMethod) NoDbgRegParms;
-void enterCogCodePopReceiver(void);
+extern void enterCogCodePopReceiver(void);
 static sqInt extABytecode(void);
 static sqInt extBBytecode(void);
 static sqInt fillInBlockHeadersAt(sqInt startAddress) NoDbgRegParms;
 static CogMethod * fillInMethodHeadersizeselector(CogMethod *method, sqInt size, sqInt selector) NoDbgRegParms;
 static usqInt findBlockMethodWithEntrystartBcpc(sqInt blockEntryMcpc, sqInt startBcpc) NoDbgRegParms;
 static sqInt findMapLocationForMcpcinMethod(sqInt targetMcpc, CogMethod *cogMethod) NoDbgRegParms;
-CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod);
+extern CogBlockMethod * findMethodForStartBcpcinHomeMethod(sqInt startbcpc, CogMethod *cogMethod);
 static sqInt findIsBackwardBranchMcpcBcpcMatchingMcpc(BytecodeDescriptor *descriptor, sqInt isBackwardBranch, char *mcpc, sqInt bcpc, void *targetMcpc) NoDbgRegParms;
-void followForwardedLiteralsIn(CogMethod *cogMethod);
-void followForwardedMethods(void);
+extern void followForwardedLiteralsIn(CogMethod *cogMethod);
+extern void followForwardedMethods(void);
 static sqInt followMaybeObjRefAt(sqInt mcpc) NoDbgRegParms;
 static sqInt followMethodReferencesInClosedPIC(CogMethod *cPIC) NoDbgRegParms;
 static void freePICsWithFreedTargets(void);
-void freeUnmarkedMachineCode(void);
+extern void freeUnmarkedMachineCode(void);
 static sqInt genCheckForInterruptsTrampoline(void);
 static void (*genEnilopmartForandandforCallcalled(sqInt regArg1, sqInt regArg2, sqInt regArg3, sqInt forCall, char *trampolineName))(void)  NoDbgRegParms;
 static void genEnilopmartReturn(sqInt forCall) NoDbgRegParms;
@@ -672,14 +656,14 @@
 static sqInt incrementUsageOfTargetIfLinkedSendmcpcignored(sqInt annotation, char *mcpc, sqInt superfluity) NoDbgRegParms;
 static sqInt initialClosedPICUsageCount(void);
 static void initializeBackend(void);
-void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
+extern void initializeCodeZoneFromupTo(sqInt startAddress, sqInt endAddress);
 static sqInt initialMethodUsageCount(void);
 static sqInt initialOpenPICUsageCount(void);
 static sqInt inverseBranchFor(sqInt opcode) NoDbgRegParms;
 static sqInt isBackwardBranchatextsin(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
 static sqInt isPCMappedAnnotation(sqInt annotation) NoDbgRegParms;
-sqInt isPCWithinMethodZone(void *address);
-sqInt isSendReturnPC(sqInt retpc);
+extern sqInt isPCWithinMethodZone(void *address);
+extern sqInt isSendReturnPC(sqInt retpc);
 static AbstractInstruction * gJumpFPEqual(void *jumpTarget) NoDbgRegParms;
 static AbstractInstruction * gJumpFPGreaterOrEqual(void *jumpTarget) NoDbgRegParms;
 static AbstractInstruction * gJumpFPGreater(void *jumpTarget) NoDbgRegParms;
@@ -689,8 +673,8 @@
 static AbstractInstruction * gLabel(void);
 static AbstractInstruction * gLogicalShiftLeftCqR(sqInt quickConstant, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * lastOpcode(void);
-void linkNSSendCacheclassTagenclosingObjecttargetcaller(NSSendCache *nsSendCache, sqInt classTag, sqInt enclosingObject, CogMethod *targetMethod, CogMethod *callingMethod);
-void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver);
+extern void linkNSSendCacheclassTagenclosingObjecttargetcaller(NSSendCache *nsSendCache, sqInt classTag, sqInt enclosingObject, CogMethod *targetMethod, CogMethod *callingMethod);
+extern void linkSendAtintooffsetreceiver(sqInt callSiteReturnAddress, CogMethod *sendingMethod, CogMethod *targetMethod, sqInt theEntryOffset, sqInt receiver);
 static void loadSubsequentBytesForDescriptorat(BytecodeDescriptor *descriptor, sqInt pc) NoDbgRegParms;
 static AbstractInstruction * gMoveAwR(sqInt address, sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gMoveCwR(sqInt wordConstant, sqInt reg) NoDbgRegParms;
@@ -705,24 +689,24 @@
 static void mapObjectReferencesInMachineCodeForBecome(void);
 static void mapObjectReferencesInMachineCodeForFullGC(void);
 static void mapObjectReferencesInMachineCodeForYoungGC(void);
-void mapObjectReferencesInMachineCode(sqInt gcMode);
-void markAndTraceMachineCodeOfMarkedMethods(void);
+extern void mapObjectReferencesInMachineCode(sqInt gcMode);
+extern void markAndTraceMachineCodeOfMarkedMethods(void);
 static void markAndTraceObjectReferencesInGeneratedRuntime(void);
 static sqInt markAndTraceOrFreeCogMethodfirstVisit(CogMethod *cogMethod, sqInt firstVisit) NoDbgRegParms;
 static sqInt markLiteralsAndUnlinkIfUnmarkedSendpcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
 static sqInt markLiteralspcmethod(sqInt annotation, char *mcpc, sqInt cogMethod) NoDbgRegParms;
-void markMethodAndReferents(CogBlockMethod *aCogMethod);
-usqInt maxCogMethodAddress(void);
+extern void markMethodAndReferents(CogBlockMethod *aCogMethod);
+extern usqInt maxCogMethodAddress(void);
 static sqInt maybeAllocAndInitIRCs(void);
 static sqInt maybeFreeCogMethodDoesntLookKosher(CogMethod *cogMethod) NoDbgRegParms;
 static sqInt maybeGenerateCheckFeatures(void);
 static sqInt maybeGenerateICacheFlush(void);
 static void maybeMarkCountersIn(CogMethod *cogMethod) NoDbgRegParms;
 static sqInt mclassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
-usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
+extern usqInt mcPCForBackwardBranchstartBcpcin(sqInt bcpc, sqInt startbcpc, CogBlockMethod *cogMethod);
 static sqInt methodhasSameCodeAscheckPenultimate(sqInt methodA, sqInt methodB, sqInt comparePenultimateLiteral) NoDbgRegParms;
-sqInt minCogMethodAddress(void);
-sqInt mnuOffset(void);
+extern sqInt minCogMethodAddress(void);
+extern sqInt mnuOffset(void);
 static AbstractInstruction * gNegateR(sqInt reg) NoDbgRegParms;
 static sqInt needsFrameIfInBlock(sqInt stackDelta) NoDbgRegParms;
 static sqInt needsFrameNever(sqInt stackDelta) NoDbgRegParms;
@@ -733,13 +717,13 @@
 static sqInt outputInstructionsForGeneratedRuntimeAt(sqInt startAddress) NoDbgRegParms;
 static AbstractInstruction * gPopR(sqInt reg) NoDbgRegParms;
 static AbstractInstruction * gPushCw(sqInt wordConstant) NoDbgRegParms;
-sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
-sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
+extern sqInt patchToOpenPICFornumArgsreceiver(sqInt selector, sqInt numArgs, sqInt receiver);
+extern sqInt pcisWithinMethod(char *address, CogMethod *cogMethod);
 static sqInt picAbortDiscriminatorValue(void);
 static sqInt picInterpretAbortOffset(void);
 static PrimitiveDescriptor * primitiveGeneratorOrNil(void);
-void printCogMethodFor(void *address);
-void printTrampolineTable(void);
+extern void printCogMethodFor(void *address);
+extern void printTrampolineTable(void);
 static sqInt processorHasDivQuoRemAndMClassIsSmallInteger(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasDivQuoRem(sqInt ignoredPrimIndex) NoDbgRegParms;
 static sqInt processorHasDoublePrecisionFloatingPointSupport(sqInt ignoredPrimIndex) NoDbgRegParms;
@@ -747,7 +731,7 @@
 static sqInt processorHasMultiply(sqInt ignoredPrimIndex) NoDbgRegParms;
 static AbstractInstruction * gRetN(sqInt offset) NoDbgRegParms;
 static void recordGeneratedRunTimeaddress(char *aString, sqInt address) NoDbgRegParms;
-sqInt recordPrimTraceFunc(void);
+extern sqInt recordPrimTraceFunc(void);
 static void recordRunTimeObjectReferences(void);
 static sqInt registerMaskFor(sqInt reg) NoDbgRegParms;
 static sqInt registerMaskForand(sqInt reg1, sqInt reg2) NoDbgRegParms;
@@ -757,29 +741,29 @@
 static sqInt remapIfObjectRefpchasYoung(sqInt annotation, char *mcpc, sqInt hasYoungPtr) NoDbgRegParms;
 static AbstractInstruction * gSubCwR(sqInt wordConstant, sqInt reg) NoDbgRegParms;
 static sqInt scanForCleanBlocks(void);
-void setBreakMethod(sqInt anObj);
-void setPostCompileHook(void (*aFunction)(CogMethod *, void *));
-void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop);
+extern void setBreakMethod(sqInt anObj);
+extern void setPostCompileHook(void (*aFunction)(CogMethod *, void *));
+extern void setSelectorOfto(CogMethod *cogMethod, sqInt aSelectorOop);
 static sqInt spanForCleanBlockStartingAt(sqInt startPC) NoDbgRegParms;
-sqInt traceLinkedSendOffset(void);
-static char * trampolineNamenumArgs(sqInt routinePrefix, sqInt numArgs) NoDbgRegParms;
-static char * trampolineNamenumRegArgs(sqInt routinePrefix, sqInt numArgs) NoDbgRegParms;
+extern sqInt traceLinkedSendOffset(void);
+static char * trampolineNamenumArgs(char *routinePrefix, sqInt numArgs) NoDbgRegParms;
+static char * trampolineNamenumRegArgs(char *routinePrefix, sqInt numArgs) NoDbgRegParms;
 static sqInt unimplementedPrimitive(void);
 static sqInt unknownBytecode(void);
-void unlinkAllSends(void);
+extern void unlinkAllSends(void);
 static sqInt unlinkIfFreeOrLinkedSendpcof(sqInt annotation, char *mcpc, sqInt theSelector) NoDbgRegParms;
 static sqInt unlinkIfInvalidClassSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) NoDbgRegParms;
 static sqInt unlinkIfLinkedSendToFreepcignored(sqInt annotation, char *mcpc, sqInt superfluity) NoDbgRegParms;
 static sqInt unlinkIfLinkedSendpcignored(sqInt annotation, char *mcpc, sqInt superfluity) NoDbgRegParms;
 static sqInt unlinkIfLinkedSendpcto(sqInt annotation, char *mcpc, sqInt theCogMethod) NoDbgRegParms;
-void unlinkSendsLinkedForInvalidClasses(void);
-void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector);
-void unlinkSendsToFree(void);
-void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue);
+extern void unlinkSendsLinkedForInvalidClasses(void);
+extern void unlinkSendsOfisMNUSelector(sqInt selector, sqInt isMNUSelector);
+extern void unlinkSendsToFree(void);
+extern void unlinkSendsToandFreeIf(sqInt targetMethodObject, sqInt freeIfTrue);
 static sqInt updateMaybeObjRefAt(sqInt mcpc) NoDbgRegParms;
 static AbstractInstruction * gXorCwR(sqInt wordConstant, sqInt reg) NoDbgRegParms;
 static void zeroOpcodeIndex(void);
-void addAllToYoungReferrers(void);
+extern void addAllToYoungReferrers(void);
 static void addToOpenPICList(CogMethod *anOpenPIC) NoDbgRegParms;
 static void addToUnpairedMethodList(CogMethod *aCogMethod) NoDbgRegParms;
 static void addToYoungReferrers(CogMethod *cogMethod) NoDbgRegParms;
@@ -788,30 +772,30 @@
 static void compactCompiledCode(void);
 static void ensureInYoungReferrers(CogMethod *cogMethod) NoDbgRegParms;
 static CogMethod * findPreviouslyCompiledVersionOfwith(sqInt aMethodObj, sqInt aSelectorOop) NoDbgRegParms;
-void freeMethod(CogMethod *cogMethod);
+extern void freeMethod(CogMethod *cogMethod);
 static void freeOlderMethodsForCompaction(void);
 static sqInt kosherYoungReferrers(void);
 static void manageFromto(sqInt theStartAddress, sqInt theLimitAddress) NoDbgRegParms;
-CogMethod * methodFor(void *address);
+extern CogMethod * methodFor(void *address);
 static sqInt numMethods(void);
-sqInt numMethodsOfType(sqInt cogMethodType);
+extern sqInt numMethodsOfType(sqInt cogMethodType);
 static sqInt occurrencesInYoungReferrers(CogMethod *cogMethod) NoDbgRegParms;
 static CogMethod * openPICWithSelector(sqInt aSelector) NoDbgRegParms;
 static void planCompaction(void);
-void printCogMethods(void);
-void printCogMethodsOfType(sqInt cmType);
-void printCogMethodsWithMethod(sqInt methodOop);
-void printCogMethodsWithPrimitive(sqInt primIdx);
-void printCogMethodsWithSelector(sqInt selectorOop);
-void printCogYoungReferrers(void);
-void printOpenPICList(void);
+extern void printCogMethods(void);
+extern void printCogMethodsOfType(sqInt cmType);
+extern void printCogMethodsWithMethod(sqInt methodOop);
+extern void printCogMethodsWithPrimitive(sqInt primIdx);
+extern void printCogMethodsWithSelector(sqInt selectorOop);
+extern void printCogYoungReferrers(void);
+extern void printOpenPICList(void);
 static sqInt pruneYoungReferrers(void);
 static sqInt relocateAndPruneYoungReferrers(void);
 static sqInt relocateMethodsPreCompaction(void);
 static sqInt removeFromOpenPICList(CogMethod *anOpenPIC) NoDbgRegParms;
 static sqInt removeFromUnpairedMethodList(CogMethod *aCogMethod) NoDbgRegParms;
 static void voidYoungReferrersPostTenureAll(void);
-char * whereIsMaybeCodeThing(sqInt anOop);
+extern char * whereIsMaybeCodeThing(sqInt anOop);
 static sqInt checkValidObjectReference(sqInt anOop) NoDbgRegParms;
 static AbstractInstruction * genCmpClassFloatCompactIndexR(sqInt reg) NoDbgRegParms;
 static AbstractInstruction * genCmpClassMethodContextCompactIndexR(sqInt reg) NoDbgRegParms;
@@ -905,7 +889,7 @@
 static void markAndTraceUpdatedLiteralin(sqInt objOop, CogMethod *cogMethodOrNil) NoDbgRegParms;
 static void markIfIRC(usqInt maybeIRCs) NoDbgRegParms;
 static sqInt maybeCompileRetryonPrimitiveFail(AbstractInstruction *retryInst, sqInt primIndex) NoDbgRegParms;
-sqInt numRegArgs(void);
+extern sqInt numRegArgs(void);
 static sqInt remapObject(sqInt objOop) NoDbgRegParms;
 static sqInt remapOop(sqInt objOop) NoDbgRegParms;
 static sqInt shouldAnnotateObjectReference(sqInt anOop) NoDbgRegParms;
@@ -991,9 +975,9 @@
 static sqInt genPushQuickIntegerConstantBytecode(void);
 static sqInt genPushReceiverVariableBytecode(void);
 static sqInt genPushTemporaryVariableBytecode(void);
-sqInt genQuickReturnConst(void);
-sqInt genQuickReturnInstVar(void);
-sqInt genQuickReturnSelf(void);
+extern sqInt genQuickReturnConst(void);
+extern sqInt genQuickReturnInstVar(void);
+extern sqInt genQuickReturnSelf(void);
 static sqInt genReturnFalse(void);
 static sqInt genReturnNil(void);
 static sqInt genReturnTrue(void);
@@ -1013,10 +997,10 @@
 static sqInt genStoreAndPopTemporaryVariableBytecode(void);
 static sqInt genStoreRemoteTempLongBytecode(void);
 static void maybeCompileAllocFillerCheck(void);
-void recordCallOffsetInof(CogMethod *cogMethod, void *callLabelArg);
+extern void recordCallOffsetInof(CogMethod *cogMethod, void *callLabelArg);
 static sqInt registerisInMask(sqInt reg, sqInt mask) NoDbgRegParms;
 static sqInt returnRegForStoreCheck(void);
-void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void));
+extern void rewritePrimInvocationInto(CogMethod *cogMethod, void (*primFunctionPointer)(void));
 static sqInt v3BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
 static sqInt v3LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
 static sqInt v3LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
@@ -1024,14 +1008,14 @@
 static sqInt v4BlockCodeSize(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
 static sqInt v4LongForwardBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
 static sqInt v4LongBranchDistance(BytecodeDescriptor *descriptor, sqInt pc, sqInt nExts, sqInt aMethodObj) NoDbgRegParms;
-void voidCogCompiledCode(void);
+extern void voidCogCompiledCode(void);
 static BlockStart * addBlockStartAtnumArgsnumCopiedspan(sqInt bytecodepc, sqInt numArgs, sqInt numCopied, sqInt span) NoDbgRegParms;
 static sqInt allocateRegForStackEntryAtnotConflictingWith(sqInt index, sqInt regMask) NoDbgRegParms;
 static sqInt allocateRegNotConflictingWith(sqInt regMask) NoDbgRegParms;
 static void annotateBytecodeIfAnnotated(CogSimStackEntry *aSimStackEntry) NoDbgRegParms;
 static sqInt anyReferencesToRegisterinTopNItems(sqInt reg, sqInt n) NoDbgRegParms;
-void callCogCodePopReceiverArg0Regs(void);
-void callCogCodePopReceiverArg1Arg0Regs(void);
+extern void callCogCodePopReceiverArg0Regs(void);
+extern void callCogCodePopReceiverArg1Arg0Regs(void);
 static sqInt compileAbstractInstructionsFromthrough(sqInt start, sqInt end) NoDbgRegParms;
 static sqInt compileBlockBodies(void);
 static void compileBlockFrameBuild(BlockStart *blockStart) NoDbgRegParms;
@@ -1188,8 +1172,6 @@
 /*** Variables ***/
 static AbstractInstruction * abstractOpcodes;
 static AbstractInstruction aMethodLabel;
-static sqInt annotationIndex;
-static InstructionAnnotation * annotations;
 static AbstractInstruction * const backEnd = &aMethodLabel;
 static usqInt baseAddress;
 static sqInt blockCount;
@@ -1859,7 +1841,7 @@
 
 
 /*** Macros ***/
-#define flushICacheFromto(me,startAddress,endAddress) __clear_cache((char*) startAddress, (char*) (endAddress + 4))
+#define flushICacheFromto(me,startAddress,endAddress) __clear_cache((char*) startAddress, (char*) (endAddress ))
 #define numberOfSaveableRegisters(self) 0
 #define cPICNumCases stackCheckOffset
 #define cPICNumCasesHack hack hack hack i.e. the getter macro does all the work
@@ -1870,24 +1852,20 @@
 #define allocateOpcodesbytecodes(numberOfAbstractOpcodes,numberOfBytecodes) do { \
 		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
 		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		int annotationSize = sizeof(InstructionAnnotation) * ((numAbstractOpcodes + 3) / 4); \
-		abstractOpcodes = alloca(opcodeSize + fixupSize + annotationSize); \
+		abstractOpcodes = alloca(opcodeSize + fixupSize); \
 		bzero(abstractOpcodes, opcodeSize + fixupSize); \
 		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		annotations = (void *)((char *)fixups + fixupSize); \
-		opcodeIndex = labelCounter = annotationIndex = 0; \
+		opcodeIndex = labelCounter = 0; \
 } while (0)
 #define allocateOpcodesbytecodesifFail(numberOfAbstractOpcodes,numberOfBytecodes,failBlock) do { \
 		int opcodeSize = sizeof(AbstractInstruction) * (numAbstractOpcodes = (numberOfAbstractOpcodes)); \
 		int fixupSize = sizeof(BytecodeFixup) * numAbstractOpcodes; \
-		int annotationSize = sizeof(InstructionAnnotation) * ((numAbstractOpcodes + 3) / 4); \
-		int allocSize = opcodeSize + fixupSize + annotationSize; \
+		int allocSize = opcodeSize + fixupSize; \
 		if (allocSize > MaxStackAllocSize) failBlock; \
 		abstractOpcodes = alloca(allocSize); \
 		bzero(abstractOpcodes, opcodeSize + fixupSize); \
 		fixups = (void *)((char *)abstractOpcodes + opcodeSize); \
-		annotations = (void *)((char *)fixups + fixupSize); \
-		opcodeIndex = labelCounter = annotationIndex = 0; \
+		opcodeIndex = labelCounter = 0; \
 } while (0)
 #define backEnd() backEnd
 #define blockAlignment(self) 8
@@ -1906,6 +1884,7 @@
 #define generatorAt(index) (&generatorTable[index])
 #define getCFramePointer() CFramePointer
 #define getCStackPointer() CStackPointer
+#define getIsObjectReference() IsObjectReference
 #define halt() warning("halt")
 #define haltmsg(msg) warning("halt: " msg)
 #define interpretOffset() missOffset
@@ -1926,7 +1905,7 @@
 #define reportError(n) warning("compilation error")
 #define setCFramePointer(theFP) (CFramePointer = (void *)(theFP))
 #define setCStackPointer(theSP) (CStackPointer = (void *)(theSP))
-#define traceMapbyteatfor(ig,no,re,d) 0
+#define traceMapinstructionbyteatfor(ig,no,r,e,d) 0
 #define tryLockVMOwner() (ceTryLockVMOwner() != 0)
 #define unlockVMOwner() ceUnlockVMOwner()
 #define nextOpenPIC methodObject
@@ -2039,7 +2018,8 @@
 static sqInt
 isAnInstruction(AbstractInstruction * self_in_isAnInstruction, AbstractInstruction *addressOrInstruction)
 {
-	return addressIsInInstructions(addressOrInstruction);
+	return (addressIsInInstructions(addressOrInstruction))
+	 || (addressOrInstruction == (methodLabel()));
 }
 
 	/* CogAbstractInstruction>>#isJump */
@@ -2070,10 +2050,10 @@
 }
 
 
-/*	To arrange that the block method field pushed in a block entry has
-	its MFMethodFlagIsBlockFlag bit set we provide labels with an offset.
-	The offset for the fakeHeader reference is MFMethodFlagIsBlockFlag.
-	See compileBlockFrameBuild: */
+/*	Hack: To arrange that the block method field pushed in a block entry has
+	its MFMethodFlagIsBlockFlag bit set we provide labels with an offset. The
+	offset for the fakeHeader reference is MFMethodFlagIsBlockFlag. See
+	compileBlockFrameBuild: */
 
 	/* CogAbstractInstruction>>#labelOffset */
 static unsigned long
@@ -2267,7 +2247,7 @@
 static sqInt
 bicsrnimmror(AbstractInstruction * self_in_bicsrnimmror, sqInt destReg, sqInt srcReg, sqInt immediate, sqInt rot)
 {

@@ Diff output truncated at 50000 characters. @@


More information about the Vm-dev mailing list